diff --git a/src/AzureOpenAIProxy.PlaygroundApp/Components/Pages/Admin.razor b/src/AzureOpenAIProxy.PlaygroundApp/Components/Pages/Admin.razor new file mode 100644 index 00000000..a03ff0aa --- /dev/null +++ b/src/AzureOpenAIProxy.PlaygroundApp/Components/Pages/Admin.razor @@ -0,0 +1,5 @@ +@page "/admin" + +Admin Page + +

Admin Dashboard Page

diff --git a/test/AzureOpenAIProxy.AppHost.Tests/PlaygroundApp/Pages/AdminPageTests.cs b/test/AzureOpenAIProxy.AppHost.Tests/PlaygroundApp/Pages/AdminPageTests.cs new file mode 100644 index 00000000..4d4f6cdb --- /dev/null +++ b/test/AzureOpenAIProxy.AppHost.Tests/PlaygroundApp/Pages/AdminPageTests.cs @@ -0,0 +1,50 @@ +using System.Net; + +using AzureOpenAIProxy.AppHost.Tests.Fixtures; + +using FluentAssertions; + +namespace AzureOpenAIProxy.AppHost.Tests.PlaygroundApp.Pages; +public class AdminPageTests(AspireAppHostFixture host) : IClassFixture +{ + [Fact] + public async Task Given_Resource_When_Invoked_Endpoint_Then_It_Should_Return_OK() + { + // Arrange + using var httpClient = host.App!.CreateHttpClient("playgroundapp"); + + // Act + var response = await httpClient.GetAsync("/admin"); + + // Assert + response.StatusCode.Should().Be(HttpStatusCode.OK); + } + + [Theory] + [InlineData("_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js")] + public async Task Given_Resource_When_Invoked_Endpoint_Then_It_Should_Return_JavaScript_Elements(string expected) + { + // Arrange + using var httpClient = host.App!.CreateHttpClient("playgroundapp"); + + // Act + var html = await httpClient.GetStringAsync("/admin"); + + // Assert + html.Should().Contain(expected); + } + + [Theory] + [InlineData("
")] + public async Task Given_Resource_When_Invoked_Endpoint_Then_It_Should_Return_HTML_Elements(string expected) + { + // Arrange + using var httpClient = host.App!.CreateHttpClient("playgroundapp"); + + // Act + var html = await httpClient.GetStringAsync("/admin"); + + // Assert + html.Should().Contain(expected); + } +} \ No newline at end of file