mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
27b3e8ad5e
* 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>
29 lines
802 B
C#
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>");
|
|
}
|
|
}
|
|
}
|