feat(dashboard): distinct 'forced' subtag provider badge
Render Fallback:Mode=ForceSubtag as a cyan 'Subtag monitoring (forced)' badge, distinct from the amber failover 'degraded' badge, so an intentional configuration isn't shown as a fault. Distinguished by the shared AlarmProviderReasons.ForcedSubtag reason carried on the provider-status feed.
This commit is contained in:
@@ -172,6 +172,28 @@ public sealed class DashboardBrowseAndAlarmModelTests
|
||||
Assert.Equal("x", model.Reason);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that a configured forced-subtag provider status renders the
|
||||
/// distinct "forced" badge (cyan/info), not the amber failover-degraded one.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void FromProviderStatus_Subtag_ForcedReason_ForcedBadge()
|
||||
{
|
||||
AlarmProviderStatus status = new()
|
||||
{
|
||||
Mode = AlarmProviderMode.Subtag,
|
||||
Degraded = true,
|
||||
Reason = ZB.MOM.WW.MxGateway.Server.Alarms.AlarmProviderReasons.ForcedSubtag,
|
||||
};
|
||||
|
||||
DashboardAlarmProviderStatus model = DashboardAlarmProviderStatus.FromProviderStatus(status);
|
||||
|
||||
Assert.True(model.IsDegraded);
|
||||
Assert.Equal(DashboardAlarmProviderStatus.ForcedSubtagLabel, model.Label);
|
||||
Assert.Contains("bg-info", model.BadgeCssClass, StringComparison.Ordinal);
|
||||
Assert.DoesNotContain("bg-warning", model.BadgeCssClass, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that the formatter renders array elements and element type correctly.</summary>
|
||||
[Fact]
|
||||
public void FormatValue_AndDataType_RenderArrayElementsAndElementType()
|
||||
|
||||
Reference in New Issue
Block a user