@@ -619,59 +619,67 @@ module("[glimmer-runtime] Updating", hooks => {
619
619
} ]
620
620
} , {
621
621
name : 'triple curlies' ,
622
- template : '<div>{{{value}}}</div>' ,
622
+ template : '<div>before {{{value}}} after </div>' ,
623
623
values : [ {
624
624
input : 'hello' ,
625
- expected : '<div>hello</div>' ,
625
+ expected : '<div>before hello after </div>' ,
626
626
description : 'plain string'
627
627
} , {
628
628
input : '<b>hello</b>' ,
629
- expected : '<div><b>hello</b></div>' ,
629
+ expected : '<div>before <b>hello</b> after </div>' ,
630
630
description : 'string containing HTML'
631
631
} , {
632
632
input : null ,
633
- expected : '<div></div>' ,
633
+ expected : '<div>before <!---> after </div>' ,
634
634
description : 'null literal'
635
635
} , {
636
636
input : undefined ,
637
- expected : '<div></div>' ,
637
+ expected : '<div>before <!---> after </div>' ,
638
638
description : 'undefined literal'
639
639
} , {
640
+ input : ' ' ,
641
+ expected : '<div>before after</div>' ,
642
+ description : 'blank string' ,
643
+ } , {
640
644
input : makeSafeString ( '<b>hello</b>' ) ,
641
- expected : '<div><b>hello</b></div>' ,
645
+ expected : '<div>before <b>hello</b> after </div>' ,
642
646
description : 'safe string containing HTML'
643
647
} , {
644
648
input : makeElement ( 'p' , 'hello' ) ,
645
- expected : '<div><p>hello</p></div>' ,
649
+ expected : '<div>before <p>hello</p> after </div>' ,
646
650
description : 'DOM node containing and element with text'
647
651
} , {
648
652
input : makeFragment ( [ makeElement ( 'p' , 'one' ) , makeElement ( 'p' , 'two' ) ] ) ,
649
- expected : '<div><p>one</p><p>two</p></div>' ,
653
+ expected : '<div>before <p>one</p><p>two</p> after </div>' ,
650
654
description : 'DOM fragment containing multiple nodes'
651
655
} , {
652
656
input : 'not modified' ,
653
- expected : '<div>not modified</div>' ,
657
+ expected : '<div>before not modified after </div>' ,
654
658
description : 'plain string (not modified, first render)'
655
659
} , {
656
660
input : 'not modified' ,
657
- expected : '<div>not modified</div>' ,
661
+ expected : '<div>before not modified after </div>' ,
658
662
description : 'plain string (not modified, second render)'
659
663
} , {
660
664
input : 0 ,
661
- expected : '<div>0 </div>' ,
665
+ expected : '<div>before 0 after </div>' ,
662
666
description : 'number literal (0)'
663
667
} , {
664
668
input : true ,
665
- expected : '<div>true</div>' ,
669
+ expected : '<div>before true after </div>' ,
666
670
description : 'boolean literal (true)'
667
671
} , {
668
672
input : {
669
673
toString ( ) {
670
674
return 'I am an Object' ;
671
675
}
672
676
} ,
673
- expected : '<div>I am an Object</div>' ,
677
+ expected : '<div>before I am an Object after </div>' ,
674
678
description : 'object with a toString function'
679
+ } , {
680
+ input : 'hello' ,
681
+ expected : '<div>before hello after</div>' ,
682
+ description : 'reset' ,
675
683
} ]
676
684
} ] . forEach ( config => {
677
685
test ( `updating ${ config . name } produces expected result` , ( ) => {
@@ -737,11 +745,11 @@ module("[glimmer-runtime] Updating", hooks => {
737
745
738
746
render ( template , input ) ;
739
747
740
- equalTokens ( root , '<div></div>' , "Initial render" ) ;
748
+ equalTokens ( root , '<div><!---->< /div>' , "Initial render" ) ;
741
749
742
750
rerender ( ) ;
743
751
744
- equalTokens ( root , '<div></div>' , "no change" ) ;
752
+ equalTokens ( root , '<div><!---->< /div>' , "no change" ) ;
745
753
746
754
input . value = '<b>Bold and spicy</b>' ;
747
755
rerender ( ) ;
@@ -751,7 +759,7 @@ module("[glimmer-runtime] Updating", hooks => {
751
759
input . value = '' ;
752
760
rerender ( ) ;
753
761
754
- equalTokens ( root , '<div></div>' , "back to empty string" ) ;
762
+ equalTokens ( root , '<div><!---->< /div>' , "back to empty string" ) ;
755
763
} ) ;
756
764
757
765
class ValueReference < T > extends ConstReference < T > {
0 commit comments