mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
test added
This commit is contained in:
@ -17,6 +17,7 @@ import myCustomControlWithoutXml = require("./mymodule/MyControl");
|
||||
import listViewModule = require("ui/list-view");
|
||||
import helper = require("../ui/helper");
|
||||
import viewModule = require("ui/core/view");
|
||||
import platform = require("platform");
|
||||
|
||||
export function test_load_IsDefined() {
|
||||
TKUnit.assert(types.isFunction(builder.load), "ui/builder should have load method!");
|
||||
@ -129,6 +130,17 @@ export function test_parse_ShouldParseBooleanPropertiesIgnoreCaseInverted() {
|
||||
TKUnit.assert(tf.editable === false, "Expected result: false; Actual result: " + tf.editable + "; type: " + typeof (tf.editable));
|
||||
};
|
||||
|
||||
export function test_parse_ShouldParsePlatofmrSpecificProperties() {
|
||||
var p = <page.Page>builder.parse("<Page><TextField ios:editable='False' android:editable='True' /></Page>");
|
||||
var tf = <textFieldModule.TextField>p.content;
|
||||
|
||||
if(platform.device.os === platform.platformNames.ios) {
|
||||
TKUnit.assert(tf.editable === true, "Expected result: false; Actual result: " + tf.editable + "; type: " + typeof (tf.editable));
|
||||
} else {
|
||||
TKUnit.assert(tf.editable === false, "Expected result: false; Actual result: " + tf.editable + "; type: " + typeof (tf.editable));
|
||||
}
|
||||
};
|
||||
|
||||
export function test_parse_ShouldParseBindings() {
|
||||
var p = <page.Page>builder.parse("<Page><Switch checked='{{ myProp }}' /></Page>");
|
||||
p.bindingContext = { myProp: true };
|
||||
@ -295,4 +307,4 @@ export function test_parse_ShouldParseNestedListViewInListViewTemplate() {
|
||||
finally {
|
||||
helper.goBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user