using Bunit; using Marathon.UI.Components; using Marathon.UI.Tests.Support; namespace Marathon.UI.Tests.Components; public sealed class SportIconTests : MarathonTestContext { [Theory] [InlineData(6)] [InlineData(11)] [InlineData(22723)] [InlineData(43658)] [InlineData(99999)] public void Renders_an_svg_for_known_and_unknown_sports(int code) { var cut = RenderComponent(p => { p.Add(c => c.Code, code); p.Add(c => c.Label, $"sport-{code}"); }); cut.Find(".m-sport").GetAttribute("data-sport").Should().Be(code.ToString()); cut.FindAll("svg").Should().NotBeEmpty(); } [Fact] public void Sets_aria_label_from_label_param() { var cut = RenderComponent(p => { p.Add(c => c.Code, 11); p.Add(c => c.Label, "Football"); }); cut.Find(".m-sport").GetAttribute("aria-label").Should().Be("Football"); } }