@RenderFooter
diff --git a/src/BootstrapBlazor/Components/Dialog/SearchDialog.razor.cs b/src/BootstrapBlazor/Components/Dialog/SearchDialog.razor.cs
index 10eb6cf0955574b59f5043283b02c4ad66c3e212..d65f7a25edda3beda4e6951e0b814346e9ff799a 100644
--- a/src/BootstrapBlazor/Components/Dialog/SearchDialog.razor.cs
+++ b/src/BootstrapBlazor/Components/Dialog/SearchDialog.razor.cs
@@ -55,15 +55,5 @@ public partial class SearchDialog
ResetButtonText ??= Localizer[nameof(ResetButtonText)];
QueryButtonText ??= Localizer[nameof(QueryButtonText)];
-
- if (OnSearchClick == null)
- {
- OnSearchClick = () => Task.CompletedTask;
- }
-
- if (OnResetSearchClick == null)
- {
- OnResetSearchClick = () => Task.CompletedTask;
- }
}
}
diff --git a/test/UnitTest/Components/DialogTest.cs b/test/UnitTest/Components/DialogTest.cs
index ba539a0a63e7cc38474dc593d341c9a507f755c4..76a352e1c8c8d4ce71a91775ef8b14407cdcd897 100644
--- a/test/UnitTest/Components/DialogTest.cs
+++ b/test/UnitTest/Components/DialogTest.cs
@@ -26,6 +26,7 @@ public class DialogTest : BootstrapBlazorTestBase
HeaderTemplate = builder => builder.AddContent(0, "Test-HeaderTemplate"),
FooterTemplate = builder => builder.AddContent(0, "Test-FooterTemplate"),
Class = "test-class",
+ ShowMaximizeButton = true,
OnCloseAsync = () =>
{
closed = true;
@@ -33,6 +34,9 @@ public class DialogTest : BootstrapBlazorTestBase
}
}));
+ // 全屏按钮
+ Assert.Contains("btn-maximize", cut.Markup);
+
// 代码覆盖模板单元测试
Assert.Contains("Test-BodyTemplate", cut.Markup);
Assert.Contains("Test-HeaderTemplate", cut.Markup);
@@ -70,10 +74,22 @@ public class DialogTest : BootstrapBlazorTestBase
Title = "Test-SearchDialogTitle",
Model = new Foo(),
ItemsPerRow = 2,
- RowType = RowType.Inline
+ RowType = RowType.Inline,
+ LabelAlign = Alignment.Left,
+ ResetButtonText = null,
+ QueryButtonText = null,
+ Items = null
};
cut.InvokeAsync(() => dialog.ShowSearchDialog(option));
- cut.InvokeAsync(() => modal.Instance.Close());
+
+ // 重置按钮委托为空 null
+ var button = cut.FindComponents