test(ui): read notification colors from app theme
This commit is contained in:
@@ -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..]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user