File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
apps/tests/xml-declaration Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,25 @@ export function test_loadWithOptionsFromTNSPath() {
133
133
TKUnit . assert ( v instanceof Label , "Expected result: Label; Actual result: " + v + ";" ) ;
134
134
} ;
135
135
136
+ export function test_loadWithAttributes ( ) {
137
+ var lText = "Nativescript rocks" ;
138
+ var lWrap = true ;
139
+ var lColor = "#FF0000" ; // red
140
+ var v = builder . load ( {
141
+ path : "ui/label" ,
142
+ name : "Label" ,
143
+ attributes : {
144
+ text : lText ,
145
+ textWrap : lWrap ,
146
+ style : "background-color: " + lColor + ";"
147
+ }
148
+ } ) ;
149
+
150
+ TKUnit . assertEqual ( v . text , lText , "Expected result: true; Actual result: " + false + ";" ) ;
151
+ TKUnit . assertEqual ( v . textWrap , lWrap , "Expected result: true; Actual result: " + false + ";" ) ;
152
+ TKUnit . assertViewColor ( v , lColor , "Expected result: true; Actual result: " + false + ";" ) ;
153
+ } ;
154
+
136
155
export function test_parse_ShouldNotCrashWithoutExports ( ) {
137
156
var file = fs . File . fromPath ( fs . path . join ( __dirname , "mainPage.xml" ) ) ;
138
157
var text = file . readTextSync ( ) ;
@@ -879,4 +898,4 @@ export function test_hasSourceCodeLocations() {
879
898
var label = page . getViewById ( "label" ) ;
880
899
var labelSource = Source . get ( label ) ;
881
900
TKUnit . assertEqual ( labelSource . toString ( ) , "file:///app/" + basePath + "examples/test-page.xml:3:5" ) ;
882
- }
901
+ }
You can’t perform that action at this time.
0 commit comments