Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add UNIT-Test
  • Loading branch information
MarvinKlein1508 committed Jun 20, 2024
commit 7e4f939daff1817ab8ea351e3718478f5fa61d09
23 changes: 23 additions & 0 deletions tests/Core/DateTime/FluentDatePickerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,27 @@ public void FluentCalendar_DisabledDate()
// Assert
calendar.Verify();
}

[Fact]
public void FluentDatePicker_ChangeValueWhenDefaultIsNull()
{
// Arrange
using var ctx = new TestContext();
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
ctx.Services.AddSingleton(LibraryConfiguration);

// Act
var picker = ctx.RenderComponent<FluentDatePicker>(parameters =>
{
parameters.Add(p => p.Value, null);
});

var textField = picker.Find("fluent-text-field");

// Set a new date value
textField.Change("2022-03-12");

// Assert
Assert.Equal(System.DateTime.Parse("2022-03-12"), picker.Instance.Value);
}
}