Skip to content

Commit

Permalink
Config test
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Aug 6, 2024
1 parent 617ce02 commit c6e1053
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Aspire.Dashboard.Tests/Integration/StartupTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,22 @@ public async Task EndPointAccessors_AppStarted_BrowserGet_Success()
Assert.NotEmpty(response.Headers.GetValues(HeaderNames.ContentSecurityPolicy).Single());
}

[Fact]
public async Task Configuration_CorsNoOtlpHttpEndpoint_Error()
{
// Arrange & Act
await using var app = IntegrationTestHelpers.CreateDashboardWebApplication(testOutputHelper,
additionalConfiguration: data =>
{
data.Remove(DashboardConfigNames.DashboardOtlpHttpUrlName.ConfigKey);
data[$"{DashboardConfigNames.DashboardOtlpCorsAllowedOriginsKeyName.ConfigKey}:0"] = "https://localhost:666";
});

// Assert
Assert.Collection(app.ValidationFailures,
s => Assert.Contains(DashboardConfigNames.DashboardOtlpHttpUrlName.ConfigKey, s));
}

private static void AssertDynamicIPEndpoint(Func<EndpointInfo> endPointAccessor)
{
// Check that the specified dynamic port of 0 is overridden with the actual port number.
Expand Down

0 comments on commit c6e1053

Please sign in to comment.