8000 Using custom component instead of label · hbcodeXCI/NativeScript@7d5953d · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d5953d

Browse files
committed
Using custom component instead of label
1 parent 26e73f4 commit 7d5953d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

apps/tests/xml-declaration/xml-declaration-tests.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,22 +135,22 @@ export function test_loadWithOptionsFromTNSPath() {
135135

136136
export function test_loadWithAttributes() {
137137
var lText = "Nativescript rocks";
138-
var lWrap = true;
139138
var lColor = "#FF0000"; // red
139+
140140
var v = builder.load({
141-
path: "tns_modules/ui/label",
142-
name: "Label",
141+
path: "~/xml-declaration/mymodulewithxml",
142+
name: "MyControl",
143+
page: new Page(),
143144
attributes: {
144-
text: lText,
145-
textWrap: lWrap,
145+
customAttribute: {
146+
text: lText
147+
},
146148
style: "background-color: " + lColor + ";"
147149
}
148150
});
149151

150-
TKUnit.assert(v instanceof Label, "Expected result: Label; Actual result: " + v + ";");
151-
TKUnit.assertEqual(v.text, lText, "Expected result: true; Actual result: " + false + ";");
152-
TKUnit.assertEqual(v.textWrap, lWrap, "Expected result: true; Actual result: " + false + ";");
153-
helper.assertViewColor(v, lColor, "Expected result: true; Actual result: " + false + ";");
152+
TKUnit.assertEqual(v.customAttribute.text, lText, "Expected result: true; Actual result: " + v + ";");
153+
helper.assertViewBackgroundColor(v, lColor, "Expected result: true; Actual result: " + false + ";");
154154
};
155155

156156
export function test_parse_ShouldNotCrashWithoutExports() {

0 commit comments

Comments
 (0)
0