Skip to content

Commit 12353f5

Browse files
authored
test(Dialog): improve code coverage (#5872)
* test(Dialog): improve code coverage * test: 更新单元测试
1 parent 80c2a0f commit 12353f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/UnitTest/Components/DialogTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ await cut.InvokeAsync(() => dialog.Show(new DialogOption()
398398
#region 弹窗中的弹窗测试
399399
await cut.InvokeAsync(() => dialog.Show(new DialogOption()
400400
{
401+
IsHidePreviousDialog = true,
401402
// 弹窗中按钮
402403
BodyTemplate = BootstrapDynamicComponent.CreateComponent<Button>(new Dictionary<string, object?>()
403404
{
@@ -414,10 +415,12 @@ await dialog.Show(new DialogOption()
414415
}
415416
}).Render()
416417
}));
418+
Assert.DoesNotContain("modal-multiple", cut.Markup);
417419

418420
// 弹出第二个弹窗
419421
var buttonInDialog = cut.Find(".btn-primary");
420422
buttonInDialog.Click();
423+
Assert.Contains("class=\"modal fade modal-multiple show\"", cut.Markup);
421424
Assert.Equal(2, cut.FindComponents<ModalDialog>().Count);
422425

423426
// 关闭第二个弹窗

0 commit comments

Comments
 (0)