tests: add test for footer component

This commit is contained in:
Stevan Freeborn
2024-04-13 19:30:57 -05:00
parent 7fb9c28064
commit 110c79a05e
+23
View File
@@ -0,0 +1,23 @@
@inherits Bunit.TestContext
@code {
[Test]
public void Footer_WhenRendered_ItShouldRenderFooterWithNavLinks()
{
var ctx = new TestContext();
var cut = ctx.Render(@<Footer />);
var footer = cut.Find("footer");
footer.Should().NotBeNull();
var navLinks = cut.FindAll("a");
navLinks.Count.Should().Be(3);
var navLinkTexts = navLinks.Select(x => x.TextContent);
navLinkTexts.Should().Contain("Code");
navLinkTexts.Should().Contain("Terms");
navLinkTexts.Should().Contain("Privacy");
}
}