platform specific component declaration support for UI builder + tests

This commit is contained in:
Vladimir Enchev
2015-06-17 10:51:32 +03:00
parent 1a9c7af8b0
commit b38d181b67
2 changed files with 40 additions and 0 deletions

View File

@@ -142,6 +142,16 @@ export function test_parse_ShouldParsePlatformSpecificProperties() {
}
};
export function test_parse_ShouldParsePlatformSpecificComponents() {
var p = <page.Page>builder.parse("<Page><ios><TextField /></ios><android><Label /></android></Page>");
if (platform.device.os === platform.platformNames.ios) {
TKUnit.assert(p.content instanceof textFieldModule.TextField, "Expected result: TextField; Actual result: " + p.content);
}
else {
TKUnit.assert(p.content instanceof labelModule.Label, "Expected result: Label; Actual result: " + p.content);
}
};
export function test_parse_ShouldParseBindings() {
var p = <page.Page>builder.parse("<Page><Switch checked='{{ myProp }}' /></Page>");
p.bindingContext = { myProp: true };