Skip to content

Commit 11189b4

Browse files
committed
Test updates
1 parent 07f2273 commit 11189b4

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

src/Components/Blazor/testassets/Wasm.Authentication.Server/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
1616
Host.CreateDefaultBuilder(args)
1717
.ConfigureWebHostDefaults(webBuilder =>
1818
{
19+
webBuilder.UseSetting(WebHostDefaults.ApplicationKey, typeof(Program).Assembly.GetName().Name);
20+
21+
// We require this line because we run in Production environment
22+
// and static web assets are only on by default during development.
1923
webBuilder.UseStaticWebAssets();
2024
webBuilder.UseStartup<Startup>();
2125
});

src/Components/Blazor/testassets/Wasm.Authentication.Server/appsettings.development.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,5 @@
55
"Microsoft": "Warning",
66
"Microsoft.Hosting.Lifetime": "Information"
77
}
8-
},
9-
"IdentityServer": {
10-
"Key": {
11-
"Type": "Development"
12-
}
138
}
149
}

src/Components/Blazor/testassets/Wasm.Authentication.Server/appsettings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
}
1111
},
1212
"IdentityServer": {
13+
"Key": {
14+
"Type": "Development"
15+
},
1316
"Clients": {
1417
"Wasm.Authentication.Client": {
1518
"Profile": "IdentityServerSPA"

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,12 @@ public WebAssemblyAuthenticationTests(
4444
ITestOutputHelper output) :
4545
base(browserFixture, serverFixture, output)
4646
{
47-
_serverFixture.Environment = AspNetEnvironment.Development;
4847
_serverFixture.ApplicationAssembly = typeof(Program).Assembly;
4948

50-
//string _staticWebAssetsFile = ResolveStaticWebAssetsManifest();
51-
5249
_serverFixture.AdditionalArguments.Clear();
53-
//_serverFixture.AdditionalArguments.AddRange(new[] { "--staticwebassets", _staticWebAssetsFile });
5450

5551
_serverFixture.BuildWebHostMethod = args => Program.CreateHostBuilder(args)
5652
.ConfigureServices(services => SetupTestDatabase<ApplicationDbContext>(services, _connection))
57-
.ConfigureWebHost(hb => hb.UseSetting(WebHostDefaults.ApplicationKey, _serverFixture.ApplicationAssembly.GetName().Name))
5853
.Build();
5954
}
6055

@@ -409,17 +404,6 @@ private void EnsureDatabaseCreated(IServiceProvider services)
409404
}
410405
}
411406

412-
private string ResolveStaticWebAssetsManifest()
413-
{
414-
var staticWebAssetsFileName = $"{typeof(Program).Assembly.GetName().Name}.StaticWebAssets.xml";
415-
var _staticWebAssetsFile = Directory.GetFiles(
416-
Path.Combine(ServerFixture.FindSampleOrTestSitePath(_serverFixture.ApplicationAssembly.FullName), "bin"),
417-
staticWebAssetsFileName,
418-
new EnumerationOptions { RecurseSubdirectories = true })
419-
.SingleOrDefault();
420-
return _staticWebAssetsFile;
421-
}
422-
423407
public void Dispose()
424408
{
425409
// Make the tests run faster by navigating back to the home page when we are done

0 commit comments

Comments
 (0)