File tree 1 file changed +24
-0
lines changed
src/Components/test/E2ETest/ServerRenderingTests 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -65,4 +65,28 @@ public void CanPerformStreamingRendering()
65
65
Browser . FindElement ( By . Id ( "end-response-link" ) ) . Click ( ) ;
66
66
Browser . Equal ( "Finished" , ( ) => getStatusText ( ) . Text ) ;
67
67
}
68
+
69
+ [ Fact ]
70
+ public void RetainsDomNodesDuringStreamingRenderingUpdates ( )
71
+ {
72
+ Navigate ( $ "{ ServerPathBase } /streaming") ;
73
+
74
+ // Initial "waiting" state
75
+ var originalH1Elem = Browser . Exists ( By . TagName ( "h1" ) ) ;
76
+ var originalStatusElem = Browser . Exists ( By . Id ( "status" ) ) ;
77
+ Assert . Equal ( "Streaming Rendering" , originalH1Elem . Text ) ;
78
+ Assert . Equal ( "Waiting for more..." , originalStatusElem . Text ) ;
79
+
80
+ // Add an item; see the old elements were retained
81
+ Browser . FindElement ( By . Id ( "add-item-link" ) ) . Click ( ) ;
82
+ var originalLi = Browser . Exists ( By . TagName ( "li" ) ) ;
83
+ Assert . Equal ( originalH1Elem . Location , Browser . Exists ( By . TagName ( "h1" ) ) . Location ) ;
84
+ Assert . Equal ( originalStatusElem . Location , Browser . Exists ( By . Id ( "status" ) ) . Location ) ;
85
+
86
+ // Make a further change; see elements (including dynamically added ones) are still retained
87
+ // even if their text was updated
88
+ Browser . FindElement ( By . Id ( "end-response-link" ) ) . Click ( ) ;
89
+ Browser . Equal ( "Finished" , ( ) => originalStatusElem . Text ) ;
90
+ Assert . Equal ( originalLi . Location , Browser . Exists ( By . TagName ( "li" ) ) . Location ) ;
91
+ }
68
92
}
You can’t perform that action at this time.
0 commit comments