11using CommunityToolkit . Aspire . Testing ;
22using Aspire . Components . Common . Tests ;
33using System . Net ;
4+ using System . Net . Http . Json ;
45
56namespace CommunityToolkit . Aspire . Hosting . Zitadel . Tests ;
67
@@ -22,9 +23,36 @@ await fixture.ResourceNotificationService
2223 var httpClient = fixture . CreateHttpClient ( resourceName ) ;
2324
2425 // Test the health endpoint
25- var response = await httpClient . GetAsync ( "/healthz" ) ;
26+ var request = new HttpRequestMessage ( HttpMethod . Get , "/.well-known/openid-configuration" ) ;
27+ // Needs to match the external domain for Zitadel or we get a 404
28+ request . Headers . Host = $ "{ resourceName } .dev.localhost";
29+ var response = await httpClient . SendAsync ( request ) ;
30+
31+ Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
32+ }
33+
34+ [ Fact ]
35+ public async Task Zitadel_Starts_And_Serves_Dashboard ( )
36+ {
37+ var resourceName = "zitadel" ;
38+
39+ // Wait for Zitadel to be healthy (it has a health check configured)
40+ await fixture . ResourceNotificationService
41+ . WaitForResourceHealthyAsync ( resourceName )
42+ . WaitAsync ( TimeSpan . FromMinutes ( 5 ) ) ;
43+
44+ var httpClient = fixture . CreateHttpClient ( resourceName ) ;
45+
46+ // Test the health endpoint
47+ var request = new HttpRequestMessage ( HttpMethod . Get , "/" ) ;
48+ // Needs to match the external domain for Zitadel or we get a 404
49+ request . Headers . Host = $ "{ resourceName } .dev.localhost";
50+ var response = await httpClient . SendAsync ( request ) ;
2651
2752 Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
53+ var body = await response . Content . ReadAsStringAsync ( ) ;
54+ Assert . Contains ( "<html" , body ) ;
55+ Assert . Contains ( "cnsl-root" , body ) ;
2856 }
2957
3058 [ Fact ]
0 commit comments