mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix span (#3510)
* 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:
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user