File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
src/AzureOpenAIProxy.PlaygroundApp/Components/Pages
test/AzureOpenAIProxy.AppHost.Tests/PlaygroundApp/Pages Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ @page " /admin"
2+
3+ <PageTitle >Admin Page</PageTitle >
4+
5+ <h1 >Admin Dashboard Page</h1 >
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments