Fixed null and undefined as Label text

This commit is contained in:
Vladimir Enchev
2016-02-11 11:12:14 +02:00
parent c1edaaca29
commit 8339d3f51d
2 changed files with 38 additions and 2 deletions

View File

@@ -89,6 +89,40 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
TKUnit.assertEqual(actualNative, expectedValue, "Native text not equal");
}
public test_Set_Text_Native_Null() {
var testLabel = this.testView;
var expectedValue = "";
testLabel.text = null;
var actualNative;
if (testLabel.ios) {
actualNative = testLabel.ios.text;
}
else {
this.waitUntilTestElementIsLoaded();
actualNative = testLabel.android.getText();
}
TKUnit.assertEqual(actualNative, expectedValue, "Native text not equal");
}
public test_Set_Text_Native_Undefined() {
var testLabel = this.testView;
var expectedValue = "";
testLabel.text = undefined;
var actualNative;
if (testLabel.ios) {
actualNative = testLabel.ios.text;
}
else {
this.waitUntilTestElementIsLoaded();
actualNative = testLabel.android.getText();
}
TKUnit.assertEqual(actualNative, expectedValue, "Native text not equal");
}
public test_Set_BackgroundColor_TNS() {
var label = this.testView;
var expectedValue = new colorModule.Color("Red");