Skip to content

Commit 7181172

Browse files
Copilotjaviercn
andcommitted
Fix WebAssemblyNestedOptionsTest by using query parameter instead of separate HTML file
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
1 parent 7c72dd2 commit 7181172

File tree

3 files changed

+21
-48
lines changed

3 files changed

+21
-48
lines changed

src/Components/test/E2ETest/Tests/WebAssemblyNestedOptionsTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ protected override void InitializeAsyncCore()
2525
{
2626
base.InitializeAsyncCore();
2727

28-
Navigate($"{ServerPathBase}/nestedWebAssemblyOptions.html");
28+
// Navigate with query parameter to trigger nested options format
29+
Navigate($"{ServerPathBase}?nested-options=true");
2930
Browser.MountTestComponent<ConfigureRuntime>();
3031
}
3132

src/Components/test/testassets/BasicTestApp/wwwroot/index.html

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,25 @@
6363
document.body.append(element);
6464
}
6565

66-
Blazor.start({
67-
configureRuntime: dotnet => {
68-
dotnet.withEnvironmentVariable("CONFIGURE_RUNTIME", "true");
69-
}
70-
});
66+
// Support both top-level and nested options format
67+
// The nested format matches what blazor.web.js uses
68+
const useNestedFormat = location.search.indexOf('nested-options=true') !== -1;
69+
70+
if (useNestedFormat) {
71+
Blazor.start({
72+
webAssembly: {
73+
configureRuntime: dotnet => {
74+
dotnet.withEnvironmentVariable("CONFIGURE_RUNTIME", "true");
75+
}
76+
}
77+
});
78+
} else {
79+
Blazor.start({
80+
configureRuntime: dotnet => {
81+
dotnet.withEnvironmentVariable("CONFIGURE_RUNTIME", "true");
82+
}
83+
});
84+
}
7185
})();
7286
</script>
7387

src/Components/test/testassets/BasicTestApp/wwwroot/nestedWebAssemblyOptions.html

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)