-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renderer support for removing root components or updating parameters on them #34232
Changes from all commits
719597a
41d9ddb
d573961
09bba1e
8d71c1e
a92a11e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,7 +396,7 @@ public async Task CreateBinder_DateTime() | |
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3); | ||
|
||
// Act | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.InvariantCulture), }); | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), }); | ||
|
||
Assert.Equal(expectedValue, value); | ||
Assert.Equal(1, component.Count); | ||
|
@@ -415,7 +415,7 @@ public async Task CreateBinder_NullableDateTime() | |
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3); | ||
|
||
// Act | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.InvariantCulture), }); | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), }); | ||
|
||
Assert.Equal(expectedValue, value); | ||
Assert.Equal(1, component.Count); | ||
|
@@ -474,7 +474,7 @@ public async Task CreateBinder_DateTimeOffset() | |
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3); | ||
|
||
// Act | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.InvariantCulture), }); | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), }); | ||
|
||
Assert.Equal(expectedValue, value); | ||
Assert.Equal(1, component.Count); | ||
|
@@ -493,7 +493,7 @@ public async Task CreateBinder_NullableDateTimeOffset() | |
var expectedValue = new DateTime(2018, 3, 4, 1, 2, 3); | ||
|
||
// Act | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.InvariantCulture), }); | ||
await binder.InvokeAsync(new ChangeEventArgs() { Value = expectedValue.ToString(CultureInfo.CurrentCulture), }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be unrelated, won't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test was wrong before. Binding works with culture-specific values. The parsing was already culture-specific, so it was incorrect to test a culture-invariant input, and was failing on my machine (using months for days, and vice-versa). The only reason it was passing in CI before was due to the cultural imperialism of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
lol, fair enough :). I only brought it up because we ran into issues in the past in this area. |
||
|
||
Assert.Equal(expectedValue, value); | ||
Assert.Equal(1, component.Count); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this trigger the disposal of all the components in the tree? I remember having to do something more "sophisticated" here (triggering an empty render).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does - disposal is recursive. There's a unit test for that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I'm glad we found a simpler way, the way I did it was a bit convoluted