Skip to content

Commit 0c1d356

Browse files
committed
test: 更新单元测试
1 parent 6e009ab commit 0c1d356

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/UnitTest/Components/DateTimePickerTest.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,25 @@ public async Task PickTimeMode_Ok()
388388
pb.Add(a => a.TimeFormat, null);
389389
});
390390
}
391+
392+
[Fact]
393+
public void IsButton_Ok()
394+
{
395+
var cut = Context.RenderComponent<DateTimePicker<DateTime>>(pb =>
396+
{
397+
pb.Add(a => a.IsButton, true);
398+
pb.Add(a => a.ButtonColor, Color.Danger);
399+
pb.Add(a => a.PickerButtonText, "Pick DateTime");
400+
});
401+
cut.Contains("btn dropdown-toggle btn-danger");
402+
403+
cut.SetParametersAndRender(pb =>
404+
{
405+
pb.Add(a => a.IsButton, false);
406+
});
407+
cut.DoesNotContain("btn dropdown-toggle btn-danger");
408+
cut.Contains("dropdown-toggle form-control datetime-picker-input");
409+
}
391410
#endregion
392411

393412
#region DatePicker

0 commit comments

Comments
 (0)