* Remove Bindable.
Fix Observable & ObservableArray tests
Fix formattedString text
Change implementation of Span, FormattedString & TextBase
properties valueChange called before native setter

* revetred formattedString tests asserts - formattedText update text property again
properties - when getting value we now use always property name instead of key (using key could return undefined for property that is set to its default value)
updated fontSize & fontInternal properties on all controls
fix font properties so that fontInternal is reset if the new font is the same as Font.default

* fix tslint errors
This commit is contained in:
Hristo Hristov
2017-01-20 16:42:20 +02:00
committed by GitHub
parent 8382e98d80
commit e34b0f622c
32 changed files with 786 additions and 1474 deletions

View File

@@ -53,9 +53,7 @@ export function test_FormattedTextProperty_IsChanged_When_SpanIsChanged() {
formattedTextChanged = true;
});
firstSpan.beginEdit();
firstSpan.fontSize = expectedValue;
firstSpan.endEdit();
TKUnit.assertTrue(formattedTextChanged, "FormattedText property is not changed.");
TKUnit.assert(formattedString.spans.getItem(0).fontSize === expectedValue, "FormattedString internal span is not changed as expected");
@@ -67,7 +65,7 @@ export function test_FormattedTextProperty_DoNotCrash_When_KnownColorIsSetForFor
const expectedValue2 = "blue";
const firstSpan = new Span();
firstSpan.foregroundColor = <any>expectedValue1;
firstSpan.color = <any>expectedValue1;
firstSpan.text = "LoremIpsum1";
formattedString.spans.push(firstSpan);
@@ -76,6 +74,6 @@ export function test_FormattedTextProperty_DoNotCrash_When_KnownColorIsSetForFor
secondSpan.text = "LoremIpsum2";
formattedString.spans.push(secondSpan);
TKUnit.assertEqual(formattedString.spans.getItem(0).foregroundColor.name, expectedValue1);
TKUnit.assertEqual(formattedString.spans.getItem(0).color.name, expectedValue1);
TKUnit.assertEqual(formattedString.spans.getItem(1).backgroundColor.name, expectedValue2);
};