Skip to content

Commit a844f3c

Browse files
Sergio0694Copilot
authored andcommitted
Avoid recursive disconnection in the TextBox lifetime test
Remove test children through their owning collection instead of recursively disconnecting the TextBox template. Recursive disconnection causes a delayed native fail-fast in WinUI TextBoxView teardown, aborting later unrelated tests. Keep the weak-reference collection assertion intact. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 2fddb34 commit a844f3c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎components/Extensions/tests/Element/FrameworkElementExtensionsTests.RelativeAncestor.cs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public async Task FrameworkElementExtension_RelativeAncestor_FreeParentBaseline(
4444

4545
Assert.IsNotNull(parent, "Couldn't find parent Grid");
4646

47-
// Remove all the children from the grid to simulate it unloading.
48-
VisualTreeHelper.DisconnectChildrenRecursive(parent);
47+
// Let templated controls tear down their internal visual trees through normal unloading.
4948
parent.Children.Clear();
5049
parent = null;
5150

0 commit comments

Comments
 (0)