mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
Using custom component instead of label
This commit is contained in:
@ -135,22 +135,22 @@ export function test_loadWithOptionsFromTNSPath() {
|
|||||||
|
|
||||||
export function test_loadWithAttributes() {
|
export function test_loadWithAttributes() {
|
||||||
var lText = "Nativescript rocks";
|
var lText = "Nativescript rocks";
|
||||||
var lWrap = true;
|
|
||||||
var lColor = "#FF0000"; // red
|
var lColor = "#FF0000"; // red
|
||||||
|
|
||||||
var v = builder.load({
|
var v = builder.load({
|
||||||
path: "tns_modules/ui/label",
|
path: "~/xml-declaration/mymodulewithxml",
|
||||||
name: "Label",
|
name: "MyControl",
|
||||||
|
page: new Page(),
|
||||||
attributes: {
|
attributes: {
|
||||||
text: lText,
|
customAttribute: {
|
||||||
textWrap: lWrap,
|
text: lText
|
||||||
|
},
|
||||||
style: "background-color: " + lColor + ";"
|
style: "background-color: " + lColor + ";"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
TKUnit.assert(v instanceof Label, "Expected result: Label; Actual result: " + v + ";");
|
TKUnit.assertEqual(v.customAttribute.text, lText, "Expected result: true; Actual result: " + v + ";");
|
||||||
TKUnit.assertEqual(v.text, lText, "Expected result: true; Actual result: " + false + ";");
|
helper.assertViewBackgroundColor(v, lColor, "Expected result: true; Actual result: " + false + ";");
|
||||||
TKUnit.assertEqual(v.textWrap, lWrap, "Expected result: true; Actual result: " + false + ";");
|
|
||||||
helper.assertViewColor(v, lColor, "Expected result: true; Actual result: " + false + ";");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function test_parse_ShouldNotCrashWithoutExports() {
|
export function test_parse_ShouldNotCrashWithoutExports() {
|
||||||
|
Reference in New Issue
Block a user