mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2025-12-06 07:28:50 +08:00
test(Toast): add ClassString unit test (#7158)
* test: 增加 StyleString 单元测试 * test: 增加 ClassString 单元测试
This commit is contained in:
@@ -255,4 +255,32 @@ public class ToastTest : BootstrapBlazorTestBase
|
||||
await cut.InvokeAsync(() => option.Close());
|
||||
Assert.True(close);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StyleString_Ok()
|
||||
{
|
||||
var cut = Context.Render<Toast>(pb =>
|
||||
{
|
||||
pb.Add(a => a.Options, new ToastOption()
|
||||
{
|
||||
StyleString = "color: red; font-size: 14px;"
|
||||
});
|
||||
});
|
||||
Assert.Contains("color: red; font-size: 14px;", cut.Markup);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ClassString_Ok()
|
||||
{
|
||||
var cut = Context.Render<Toast>(pb =>
|
||||
{
|
||||
pb.Add(a => a.Options, new ToastOption()
|
||||
{
|
||||
ClassString = "custom-class another-class"
|
||||
});
|
||||
});
|
||||
Assert.Contains("toast", cut.Markup);
|
||||
Assert.Contains("custom-class", cut.Markup);
|
||||
Assert.Contains("another-class", cut.Markup);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user