mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
68966ef511
Co-authored-by: James Yeung <shunjiey@hotmail.com>
51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
@inherits AntDesignTestBase
|
|
@code {
|
|
[Fact]
|
|
public void Renders_basic_divider()
|
|
{
|
|
var cut = Context.Render(@<AntDesign.Divider/>);
|
|
var id = (cut.Nodes.First() as IElement).GetAttribute("id");
|
|
cut.MarkupMatches(@<span class="ant-divider ant-divider-horizontal" id="@id"></span>);
|
|
}
|
|
|
|
[Fact]
|
|
public void Renders_divider_with_title()
|
|
{
|
|
var style = "font-weight:bold";
|
|
var orientation = "left";
|
|
|
|
var cut = Context.Render(@<AntDesign.Divider Orientation="@orientation" Style="@style">A Title</AntDesign.Divider>);
|
|
var id = (cut.Nodes.First() as IElement).GetAttribute("id");
|
|
cut.MarkupMatches(
|
|
@<span class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-left" style="@style" id="@id">
|
|
<span class="ant-divider-inner-text">A Title</span>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
[Fact]
|
|
public void Renders_divider_vertical()
|
|
{
|
|
var cut = Context.Render(
|
|
@<text>
|
|
Text
|
|
<AntDesign.Divider Type=@DirectionVHType.Vertical/>
|
|
<a href="#">Link 1</a>
|
|
<AntDesign.Divider Type=@DirectionVHType.Vertical/>
|
|
<a href="#">Link 2</a>
|
|
</text>
|
|
);
|
|
var spanNodes = cut.Nodes.GetElementsByTagName("span");
|
|
var id1 = spanNodes.First().GetAttribute("id");
|
|
var id2 = spanNodes.Last().GetAttribute("id");
|
|
cut.MarkupMatches(
|
|
@<text>
|
|
Text
|
|
<span class="ant-divider ant-divider-vertical" id="@id1"></span>
|
|
<a href="#">Link 1</a>
|
|
<span class="ant-divider ant-divider-vertical" id="@id2"></span>
|
|
<a href="#">Link 2</a>
|
|
</text>
|
|
);
|
|
}
|
|
} |