ant-design-blazor/tests/AntDesign.Tests/Divider/DividerTests.razor
Andrzej Bakun 555fdb9a43 fix(module: checkbox & switch): Checked parameter binding (#1394)
* fix(module:checkbox): allow binding to Checked parameter

* fix(module:switch): allow binding to Checked parameter

* fix(modules): checkbox & switch get AntInputBoolComponentBase class

* test(module:switch): add tests

* test(module:checkbox): add tests

* test(module:divider): simplify by using id:ignore

* docs(module:checkbox): bind example

* docs(module:switch): bind example

* fix(module:switch): add Control + docs + tests

* feat(module:checkboxgroup): add layout and mixed mode

* fix: review comments + tests

* fix(module:checkboxgroup): parameter name should be MixedMode

added more tests

* fix demo

* fix(module:checkboxgroup): allow toggling between modes

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2021-04-25 01:04:21 +08:00

47 lines
1.3 KiB
C#

@inherits AntDesignTestBase
@code {
[Fact]
public void Renders_basic_divider()
{
var cut = Context.Render(@<AntDesign.Divider/>);
cut.MarkupMatches(@<span class="ant-divider ant-divider-horizontal" id:ignore></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>);
cut.MarkupMatches(
@<span class="ant-divider ant-divider-horizontal ant-divider-with-text ant-divider-with-text-left" style="@style" id:ignore>
<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");
cut.MarkupMatches(
@<text>
Text
<span class="ant-divider ant-divider-vertical" id:ignore></span>
<a href="#">Link 1</a>
<span class="ant-divider ant-divider-vertical" id:ignore></span>
<a href="#">Link 2</a>
</text>
);
}
}