Skip to content

Commit 485cbe9

Browse files
authored
[Admin] Component: Landing Page(Page) #235 (#242)
1 parent 39d8c9f commit 485cbe9

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@page "/admin"
2+
3+
<PageTitle>Admin Page</PageTitle>
4+
5+
<h1>Admin Dashboard Page</h1>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System.Net;
2+
3+
using AzureOpenAIProxy.AppHost.Tests.Fixtures;
4+
5+
using FluentAssertions;
6+
7+
namespace AzureOpenAIProxy.AppHost.Tests.PlaygroundApp.Pages;
8+
public class AdminPageTests(AspireAppHostFixture host) : IClassFixture<AspireAppHostFixture>
9+
{
10+
[Fact]
11+
public async Task Given_Resource_When_Invoked_Endpoint_Then_It_Should_Return_OK()
12+
{
13+
// Arrange
14+
using var httpClient = host.App!.CreateHttpClient("playgroundapp");
15+
16+
// Act
17+
var response = await httpClient.GetAsync("/admin");
18+
19+
// Assert
20+
response.StatusCode.Should().Be(HttpStatusCode.OK);
21+
}
22+
23+
[Theory]
24+
[InlineData("_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js")]
25+
public async Task Given_Resource_When_Invoked_Endpoint_Then_It_Should_Return_JavaScript_Elements(string expected)
26+
{
27+
// Arrange
28+
using var httpClient = host.App!.CreateHttpClient("playgroundapp");
29+
30+
// Act
31+
var html = await httpClient.GetStringAsync("/admin");
32+
33+
// Assert
34+
html.Should().Contain(expected);
35+
}
36+
37+
[Theory]
38+
[InlineData("<div class=\"fluent-tooltip-provider\"></div>")]
39+
public async Task Given_Resource_When_Invoked_Endpoint_Then_It_Should_Return_HTML_Elements(string expected)
40+
{
41+
// Arrange
42+
using var httpClient = host.App!.CreateHttpClient("playgroundapp");
43+
44+
// Act
45+
var html = await httpClient.GetStringAsync("/admin");
46+
47+
// Assert
48+
html.Should().Contain(expected);
49+
}
50+
}

0 commit comments

Comments
 (0)