ant-design-blazor/tests/AntDesign.Tests/Breadcrumb/BreadcrumbTests.cs
kooliokey 27b3e8ad5e
feat(module: breadcrumb): Add OnClick parameter to BreadcrumbItem, Add Tests, Remove unusable code (#2655)
* Add OnClick parameter to BreadcrumbItem. Add tests for Breadcrumb and BreadcrumbItem. Remove unused and unreachable code until needed at a later date. Documented parameters not in use, but left to avoid breaking the existing public API.

* Fix whitespace

* Update signature of OnClick for BreadcrumbItem to pass a Tuple<MouseEventArgs, BreadcrumbItem> giving access to the click arguments and the item clicked.

* Add ExludeFromCodeCoverage to POCO

* Update HTML markup for Breadcrumbs to match React Ant.Design (use nav, ol and li elements instead of div and spans only)

* fix naming

* fix error

* fix test

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2022-09-04 02:33:10 +08:00

29 lines
802 B
C#

using System.Threading.Tasks;
using AntDesign.JsInterop;
using Bunit;
using FluentAssertions;
using Microsoft.AspNetCore.Components;
using Xunit;
namespace AntDesign.Tests.Breadcrumb
{
public class BreadcrumbTests : AntDesignTestBase
{
[Fact]
public void ItShouldRenderWrapperProperly()
{
var systemUnderTest = RenderComponent<AntDesign.Breadcrumb>();
systemUnderTest.MarkupMatches("<nav class=\"ant-breadcrumb\" id:ignore><ol></ol></nav>");
}
[Fact]
public void ItShouldRenderChildContent()
{
var systemUnderTest = RenderComponent<AntDesign.Breadcrumb>(p => p.AddChildContent("<span>Test</span>"));
systemUnderTest.Find("span").MarkupMatches("<span>Test</span>");
}
}
}