Skip to content

Commit 6d2161b

Browse files
committed
Ensures single click event invocation
Adds a wait to ensure that the click event is only invoked a single time after a click.
1 parent fbf2329 commit 6d2161b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/MaterialDesignThemes.UITests/WPF/SplitButtons/SplitButtonTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ public async Task SplitButton_WithButtonInPopup_CanBeInvoked()
9999
await Wait.For(async () => await popupContent.GetIsVisible());
100100
await Wait.For(async () => await popupContent.GetActualHeight() > 10);
101101
await popupContent.LeftClick();
102-
await Task.Delay(50);
103102

104103
// Assert
105-
var invocations = await clickEvent.GetInvocations();
106-
Assert.Single(invocations);
107-
104+
await Wait.For(async () =>
105+
{
106+
var invocations = await clickEvent.GetInvocations();
107+
Assert.Single(invocations);
108+
});
109+
108110
recorder.Success();
109111
}
110112

0 commit comments

Comments
 (0)