From e28454031848151161a7a60c6a1955fe956a5f25 Mon Sep 17 00:00:00 2001 From: jeff377 Date: Wed, 2 Dec 2026 00:32:52 +0800 Subject: [PATCH] Await the cancel click in the Blazor edit test The synchronous Click dispatches without waiting, so on a busy renderer the assertion could run before the cancel handler. It failed once on main. --- tests/Polhem.Chat.Blazor.UnitTests/ComposingTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Polhem.Chat.Blazor.UnitTests/ComposingTests.cs b/tests/Polhem.Chat.Blazor.UnitTests/ComposingTests.cs index fefa235..4da6101 100644 --- a/tests/Polhem.Chat.Blazor.UnitTests/ComposingTests.cs +++ b/tests/Polhem.Chat.Blazor.UnitTests/ComposingTests.cs @@ -200,7 +200,7 @@ public async Task Edit_CancelButton() view.WaitForAssertion(() => Assert.Single(view.FindAll(".pch-edit"))); await view.Find(".pch-edit").ClickAsync(new()); - view.Find(".pch-cancel-edit").Click(); + await view.Find(".pch-cancel-edit").ClickAsync(new()); Assert.False(view.Instance.IsEditingPrompt); Assert.Equal(string.Empty, view.Find(".pch-prompt-box").GetAttribute("value"));