@@ -529,9 +529,7 @@ function test_font_shorthand_property(short: string, family: string, size: numbe
529529 TKUnit . assertEqual ( testView . style . fontWeight , weight , "style.fontWeight" ) ;
530530 TKUnit . assertEqual ( testView . style . fontSize , size , "style.fontSize" ) ;
531531}
532-
533532export function test_setting_font_properties_sets_native_font ( ) {
534-
535533 if ( fontModule . ios ) {
536534 var basePath = "fonts" ;
537535 fontModule . ios . registerFont ( basePath + "/Roboto-Regular.ttf" ) ;
@@ -571,6 +569,22 @@ function test_native_font(style: string, weight: string) {
571569 //TODO: If needed add tests for other platforms
572570}
573571
572+ export function test_FontWeightsParsedAsNumbersByTheXmlParserAreConvertedToStrings ( ) {
573+ var testView = new buttonModule . Button ( ) ;
574+ // The XML parser will interpret "100" as a number and feed it to Style, so simulate this here.
575+ ( < any > testView . style ) . fontWeight = 100 ; TKUnit . assertEqual ( testView . style . fontWeight , "100" ) ;
576+ ( < any > testView . style ) . fontWeight = 200 ; TKUnit . assertEqual ( testView . style . fontWeight , "200" ) ;
577+ ( < any > testView . style ) . fontWeight = 300 ; TKUnit . assertEqual ( testView . style . fontWeight , "300" ) ;
578+ ( < any > testView . style ) . fontWeight = 400 ; TKUnit . assertEqual ( testView . style . fontWeight , "400" ) ;
579+ ( < any > testView . style ) . fontWeight = "normal" ; TKUnit . assertEqual ( testView . style . fontWeight , "normal" ) ;
580+ ( < any > testView . style ) . fontWeight = 500 ; TKUnit . assertEqual ( testView . style . fontWeight , "500" ) ;
581+ ( < any > testView . style ) . fontWeight = 600 ; TKUnit . assertEqual ( testView . style . fontWeight , "600" ) ;
582+ ( < any > testView . style ) . fontWeight = 700 ; TKUnit . assertEqual ( testView . style . fontWeight , "700" ) ;
583+ ( < any > testView . style ) . fontWeight = "bold" ; TKUnit . assertEqual ( testView . style . fontWeight , "bold" ) ;
584+ ( < any > testView . style ) . fontWeight = 800 ; TKUnit . assertEqual ( testView . style . fontWeight , "800" ) ;
585+ ( < any > testView . style ) . fontWeight = 900 ; TKUnit . assertEqual ( testView . style . fontWeight , "900" ) ;
586+ }
587+
574588export var test_setting_button_whiteSpace_normal_sets_native = function ( ) {
575589 var testView = new buttonModule . Button ( ) ;
576590 testView . style . whiteSpace = "nowrap" ;
0 commit comments