@@ -6,8 +6,6 @@ import textViewTestsNative = require("./text-view-tests-native");
66import colorModule = require( "color" ) ;
77import enums = require( "ui/enums" ) ;
88import platform = require( "platform" ) ;
9- import formattedStringModule = require( "text/formatted-string" ) ;
10- import spanModule = require( "text/span" ) ;
119
1210// >> require-textmodules
1311import textViewModule = require( "ui/text-view" ) ;
@@ -497,14 +495,9 @@ export function test_watch_listerer_is_removed_at_onDetach() {
497495 }
498496}
499497
500- export var test_IntegrationTest_Transform_Decoration_Spacing_WithoutFormattedText_DoesNotCrash = function ( ) {
498+ export function test_IntegrationTest_Transform_Decoration_Spacing_WithoutFormattedText_DoesNotCrash ( ) {
501499 let view = new textViewModule . TextView ( ) ;
502500 helper . buildUIAndRunTest ( view , function ( views : Array < viewModule . View > ) {
503- TKUnit . assertEqual ( view . text , "" , "Text" ) ;
504- TKUnit . assertEqual ( view . style . textTransform , enums . TextTransform . none , "TextTransform" ) ;
505- TKUnit . assertEqual ( view . style . textDecoration , enums . TextDecoration . none , "TextDecoration" ) ;
506- TKUnit . assertTrue ( isNaN ( view . style . letterSpacing ) , "LetterSpacing" ) ;
507-
508501 view . text = "NormalText" ;
509502 view . setInlineStyle ( "text-transform: uppercase; text-decoration: underline; letter-spacing: 10;" ) ;
510503
@@ -514,49 +507,15 @@ export var test_IntegrationTest_Transform_Decoration_Spacing_WithoutFormattedTex
514507 } ) ;
515508}
516509
517- export var test_IntegrationTest_Transform_Decoration_Spacing_WithFormattedText_DoesNotCrash = function ( ) {
510+ export function test_IntegrationTest_Transform_Decoration_Spacing_WithFormattedText_DoesNotCrash ( ) {
518511 let view = new textViewModule . TextView ( ) ;
519- let formattedString = _generateFormattedString ( ) ;
512+ let formattedString = helper . _generateFormattedString ( ) ;
520513 helper . buildUIAndRunTest ( view , function ( views : Array < viewModule . View > ) {
521- TKUnit . assertEqual ( view . text , "" , "Text" ) ;
522- TKUnit . assertEqual ( view . style . textTransform , enums . TextTransform . none , "TextTransform" ) ;
523- TKUnit . assertEqual ( view . style . textDecoration , enums . TextDecoration . none , "TextDecoration" ) ;
524- TKUnit . assertTrue ( isNaN ( view . style . letterSpacing ) , "LetterSpacing" ) ;
525-
526514 view . formattedText = formattedString ;
527515 view . setInlineStyle ( "text-transform: uppercase; text-decoration: underline; letter-spacing: 10;" ) ;
528516
529517 TKUnit . assertEqual ( view . style . textTransform , enums . TextTransform . uppercase , "TextTransform" ) ;
530518 TKUnit . assertEqual ( view . style . textDecoration , enums . TextDecoration . underline , "TextDecoration" ) ;
531519 TKUnit . assertEqual ( view . style . letterSpacing , 10 , "LetterSpacing" ) ;
532520 } ) ;
533- }
534-
535- function _generateFormattedString ( ) : formattedStringModule . FormattedString {
536- let formattedString = new formattedStringModule . FormattedString ( ) ;
537- let span : spanModule . Span ;
538-
539- span = new spanModule . Span ( ) ;
540- span . fontFamily = "serif" ;
541- span . fontSize = 10 ;
542- span . fontAttributes = enums . FontAttributes . Bold ;
543- span . foregroundColor = new colorModule . Color ( "red" ) ;
544- span . backgroundColor = new colorModule . Color ( "blue" ) ;
545- span . underline = 0 ;
546- span . strikethrough = 1 ;
547- span . text = "Formatted" ;
548- formattedString . spans . push ( span ) ;
549-
550- span = new spanModule . Span ( ) ;
551- span . fontFamily = "sans-serif" ;
552- span . fontSize = 20 ;
553- span . fontAttributes = enums . FontAttributes . Italic ;
554- span . foregroundColor = new colorModule . Color ( "green" ) ;
555- span . backgroundColor = new colorModule . Color ( "yellow" ) ;
556- span . underline = 1 ;
557- span . strikethrough = 0 ;
558- span . text = "Text" ;
559- formattedString . spans . push ( span ) ;
560-
561- return formattedString ;
562- }
521+ }
0 commit comments