@@ -14,6 +14,14 @@ namespace BlazorWasmPreRendering.Build.Test;
1414
1515public class ProgramE2ETest
1616{
17+ private const string LoadingContents =
18+ "<svg class=\" loading-progress\" >\n " +
19+ " <circle r=\" 40%\" cx=\" 50%\" cy=\" 50%\" ></circle>\n " +
20+ " <circle r=\" 40%\" cx=\" 50%\" cy=\" 50%\" ></circle>\n " +
21+ " </svg>\n " +
22+ " <div class=\" loading-progress-text\" ></div>\n " +
23+ " " ;
24+
1725 [ Test ]
1826 public async Task HeadOutlet_TestAsync ( )
1927 {
@@ -89,13 +97,12 @@ public async Task Including_ServerSide_Middleware_Legacy_TestAsync(bool shouldDe
8997 actualHtmlFiles . Is ( expectedHtmlFiles ) ;
9098
9199 // NOTICE: The document title was rendered by the Toolbelt.Blazor.HeadElement
92- const string loadingContents = "Loading..." ;
93- Validate ( actualHtmlFiles [ 4 ] , loadingContents , title_is : "Home" , h1_is : "Hello, world!" , shouldDeleteLoadingContents ) ;
94- Validate ( actualHtmlFiles [ 2 ] , loadingContents , title_is : "Counter" , h1_is : "Counter" , shouldDeleteLoadingContents ) ;
95- Validate ( actualHtmlFiles [ 3 ] , loadingContents , title_is : "Weather forecast" , h1_is : "Weather forecast" , shouldDeleteLoadingContents ) ;
96- Validate ( actualHtmlFiles [ 0 ] , loadingContents , title_is : "About .NET" , h1_is : "About .NET" , shouldDeleteLoadingContents ) ;
97- Validate ( actualHtmlFiles [ 5 ] , loadingContents , title_is : "BlazorWasmApp1" , h1_is : "Lazy Loading Page" , shouldDeleteLoadingContents ) ;
98- Validate ( actualHtmlFiles [ 1 ] , loadingContents , title_is : "BlazorWasmApp1" , h1_is : "Sorry, there's nothing at this address." , shouldDeleteLoadingContents ) ;
100+ Validate ( actualHtmlFiles [ 4 ] , LoadingContents , title_is : "Home" , h1_is : "Hello, world!" , shouldDeleteLoadingContents ) ;
101+ Validate ( actualHtmlFiles [ 2 ] , LoadingContents , title_is : "Counter" , h1_is : "Counter" , shouldDeleteLoadingContents ) ;
102+ Validate ( actualHtmlFiles [ 3 ] , LoadingContents , title_is : "Weather forecast" , h1_is : "Weather forecast" , shouldDeleteLoadingContents ) ;
103+ Validate ( actualHtmlFiles [ 0 ] , LoadingContents , title_is : "About .NET" , h1_is : "About .NET" , shouldDeleteLoadingContents ) ;
104+ Validate ( actualHtmlFiles [ 5 ] , LoadingContents , title_is : "BlazorWasmApp1" , h1_is : "Lazy Loading Page" , shouldDeleteLoadingContents ) ;
105+ Validate ( actualHtmlFiles [ 1 ] , LoadingContents , title_is : "BlazorWasmApp1" , h1_is : "Sorry, there's nothing at this address." , shouldDeleteLoadingContents ) ;
99106 }
100107
101108 [ Test ]
@@ -180,14 +187,13 @@ public async Task Including_EasterEggPage_TestAsync(bool shouldDeleteLoadingCont
180187 actualHtmlFiles . Is ( expectedHtmlFiles ) ;
181188
182189 // NOTICE: The document title was rendered by the Toolbelt.Blazor.HeadElement
183- const string loadingContents = "Loading..." ;
184- Validate ( actualHtmlFiles [ 5 ] , loadingContents , title_is : "Home" , h1_is : "Hello, world!" , shouldDeleteLoadingContents ) ;
185- Validate ( actualHtmlFiles [ 2 ] , loadingContents , title_is : "Counter" , h1_is : "Counter" , shouldDeleteLoadingContents ) ;
186- Validate ( actualHtmlFiles [ 4 ] , loadingContents , title_is : "Weather forecast" , h1_is : "Weather forecast" , shouldDeleteLoadingContents ) ;
187- Validate ( actualHtmlFiles [ 1 ] , loadingContents , title_is : "About .NET" , h1_is : "About .NET" , shouldDeleteLoadingContents ) ;
188- Validate ( actualHtmlFiles [ 6 ] , loadingContents , title_is : "BlazorWasmApp1" , h1_is : "Lazy Loading Page" , shouldDeleteLoadingContents ) ;
189- Validate ( actualHtmlFiles [ 0 ] , loadingContents , title_is : "BlazorWasmApp1" , h1_is : "Sorry, there's nothing at this address." , shouldDeleteLoadingContents ) ;
190- Validate ( actualHtmlFiles [ 3 ] , loadingContents , title_is : "Easter Egg" , h1_is : "Hello, Easter Egg!" , shouldDeleteLoadingContents ) ;
190+ Validate ( actualHtmlFiles [ 5 ] , LoadingContents , title_is : "Home" , h1_is : "Hello, world!" , shouldDeleteLoadingContents ) ;
191+ Validate ( actualHtmlFiles [ 2 ] , LoadingContents , title_is : "Counter" , h1_is : "Counter" , shouldDeleteLoadingContents ) ;
192+ Validate ( actualHtmlFiles [ 4 ] , LoadingContents , title_is : "Weather forecast" , h1_is : "Weather forecast" , shouldDeleteLoadingContents ) ;
193+ Validate ( actualHtmlFiles [ 1 ] , LoadingContents , title_is : "About .NET" , h1_is : "About .NET" , shouldDeleteLoadingContents ) ;
194+ Validate ( actualHtmlFiles [ 6 ] , LoadingContents , title_is : "BlazorWasmApp1" , h1_is : "Lazy Loading Page" , shouldDeleteLoadingContents ) ;
195+ Validate ( actualHtmlFiles [ 0 ] , LoadingContents , title_is : "BlazorWasmApp1" , h1_is : "Sorry, there's nothing at this address." , shouldDeleteLoadingContents ) ;
196+ Validate ( actualHtmlFiles [ 3 ] , LoadingContents , title_is : "Easter Egg" , h1_is : "Hello, Easter Egg!" , shouldDeleteLoadingContents ) ;
191197 }
192198
193199 private static string [ ] GetFullPathList ( string baseDir , params string [ ] pathList )
@@ -268,8 +274,8 @@ public async Task AppComponent_is_in_the_other_Assembly_TestAsync(bool deleteLoa
268274 var actualHtmlFiles = Directory . GetFiles ( wwwrootDir , "*.html" , SearchOption . AllDirectories ) . OrderBy ( path => path ) . ToArray ( ) ;
269275 actualHtmlFiles . Is ( expectedHtmlFiles ) ;
270276
271- Validate ( actualHtmlFiles [ 0 ] , BlazorWasmApp2 . LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "About Page" , deleteLoadingContents ) ;
272- Validate ( actualHtmlFiles [ 1 ] , BlazorWasmApp2 . LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "Welcome to Blazor Wasm App 2!" , deleteLoadingContents ) ;
277+ Validate ( actualHtmlFiles [ 0 ] , LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "About Page" , deleteLoadingContents ) ;
278+ Validate ( actualHtmlFiles [ 1 ] , LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "Welcome to Blazor Wasm App 2!" , deleteLoadingContents ) ;
273279 }
274280
275281 [ TestCase ( true ) ]
@@ -310,8 +316,8 @@ public async Task AppComponent_is_in_the_other_Assembly_and_FallBack_TestAsync(b
310316 var actualHtmlFiles = Directory . GetFiles ( wwwrootDir , "*.html" , SearchOption . AllDirectories ) . OrderBy ( path => path ) . ToArray ( ) ;
311317 actualHtmlFiles . Is ( expectedHtmlFiles ) ;
312318
313- Validate ( actualHtmlFiles [ 0 ] , BlazorWasmApp2 . LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "About Page" , deleteLoadingContents ) ;
314- Validate ( actualHtmlFiles [ 1 ] , BlazorWasmApp2 . LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "Welcome to Blazor Wasm App 2!" , deleteLoadingContents ) ;
319+ Validate ( actualHtmlFiles [ 0 ] , LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "About Page" , deleteLoadingContents ) ;
320+ Validate ( actualHtmlFiles [ 1 ] , LoadingContents , title_is : "BlazorWasmApp2.Client" , h1_is : "Welcome to Blazor Wasm App 2!" , deleteLoadingContents ) ;
315321 }
316322
317323 [ Test ]
0 commit comments