namespace ZB.MOM.WW.Theme.Tests;

public class StatusPillTests : TestContext
{
    [Theory]
    [InlineData(StatusState.Ok, "chip-ok")]
    [InlineData(StatusState.Warn, "chip-warn")]
    [InlineData(StatusState.Bad, "chip-bad")]
    [InlineData(StatusState.Idle, "chip-idle")]
    [InlineData(StatusState.Info, "chip-info")]
    public void Maps_state_to_chip_class(StatusState state, string expected)
    {
        var cut = RenderComponent<StatusPill>(p => p
            .Add(x => x.State, state)
            .AddChildContent("Connected"));
        var span = cut.Find("span");
        Assert.Contains("chip", span.ClassList);
        Assert.Contains(expected, span.ClassList);
        Assert.Equal("Connected", span.TextContent.Trim());
    }
}
