@@ -162,10 +162,10 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
162162 const span = new Span ( ) ;
163163 span . text = "long label" ;
164164 span . fontWeight = "bold" ;
165-
165+
166166 const span2 = new Span ( ) ;
167167 span2 . text = "long label" ;
168-
168+
169169 const formattedString = new FormattedString ( ) ;
170170 formattedString . spans . push ( span ) ;
171171 formattedString . spans . push ( span2 ) ;
@@ -176,7 +176,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
176176 const span3 = new Span ( ) ;
177177 span3 . text = "short label" ;
178178 span3 . fontWeight = "bold" ;
179-
179+
180180 const formattedString2 = new FormattedString ( ) ;
181181 formattedString2 . spans . push ( span3 ) ;
182182 label . formattedText = formattedString2 ;
@@ -210,7 +210,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
210210 const span = new Span ( ) ;
211211 span . text = "short label" ;
212212 span . fontWeight = "bold" ;
213-
213+
214214 const formattedString = new FormattedString ( ) ;
215215 formattedString . spans . push ( span ) ;
216216 label . formattedText = formattedString ;
@@ -220,10 +220,10 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
220220 const span2 = new Span ( ) ;
221221 span2 . text = "long label" ;
222222 span2 . fontWeight = "bold" ;
223-
223+
224224 const span3 = new Span ( ) ;
225225 span3 . text = "long label" ;
226-
226+
227227 const formattedString2 = new FormattedString ( ) ;
228228 formattedString2 . spans . push ( span2 ) ;
229229 formattedString2 . spans . push ( span3 ) ;
@@ -733,6 +733,21 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
733733 return host ;
734734 } ) ;
735735 }
736+
737+ public test_FormattedText_ShouldNotCrash_WheRemovedFromSpan ( ) {
738+ const label = this . testView ;
739+ label . color = new colorModule . Color ( "red" ) ;
740+ this . waitUntilTestElementIsLoaded ( ) ;
741+
742+ const span = new Span ( ) ;
743+ span . text = "test" ;
744+
745+ const formattedString = new FormattedString ( ) ;
746+ formattedString . spans . push ( span ) ;
747+
748+ label . _addChildFromBuilder ( "FormattedString" , formattedString ) ;
749+ label . _removeView ( formattedString ) ;
750+ } ;
736751}
737752
738753export function createTestCase ( ) : LabelTest {
0 commit comments