test(ui): read notification colors from app theme

This commit is contained in:
2026-11-02 11:24:50 -08:00
parent 82609a5046
commit caf91e6564
2 changed files with 17 additions and 7 deletions
+11 -3
View File
@@ -11,8 +11,13 @@ namespace ytLive.Tests;
/// Errors must never auto-expire (sticky until dismissed); the rest get short
/// lifetimes; everything routes to the in-window ToastArea.
/// </summary>
[Collection("RealApp")]
public class NotificationServiceTests
{
private readonly RealAppHost _app;
public NotificationServiceTests(RealAppHost app) => _app = app;
[Theory]
[InlineData(AppNotificationSeverity.Info, 4)]
[InlineData(AppNotificationSeverity.Success, 4)]
@@ -39,11 +44,14 @@ public class NotificationServiceTests
[InlineData(AppNotificationSeverity.Info, "#3a3b52")]
[InlineData(AppNotificationSeverity.Success, "#1d5c38")]
[InlineData(AppNotificationSeverity.Warning, "#b8860b")]
[InlineData(AppNotificationSeverity.Error, "#8f1f1f")]
[InlineData(AppNotificationSeverity.Error, "#93000a")]
public void Severities_Map_To_Dark_Card_Tints(AppNotificationSeverity severity, string expectedHex)
{
var request = NotificationService.BuildRequest("Title", "Body", severity);
_app.Run(() =>
{
var request = NotificationService.BuildRequest("Title", "Body", severity);
Assert.Equal(expectedHex.ToLowerInvariant()[^6..], request.BackgroundColor!.Value.ToHex().ToLowerInvariant()[^6..]);
Assert.Equal(expectedHex.ToLowerInvariant()[^6..], request.BackgroundColor!.Value.ToHex().ToLowerInvariant()[^6..]);
});
}
}