From febbff46bda5a5e3dd62f3bdb4cc0b01f332de5f Mon Sep 17 00:00:00 2001 From: audichuang <72485427+audichuang@users.noreply.github.com> Date: Sun, 6 Dec 2026 05:28:46 +0800 Subject: [PATCH] test(settings): wait for the .NET SDK list instead of the unpinned placeholder (#8295) The .NET settings test waited for the SDK combo to read Not pinned, the placeholder shown before sdkDotnetStatus answers, so it read the SDK list whenever the answer happened to have rendered. It now waits for the list and checks the placeholder after. Co-authored-by: audichuang <72485427+audichuang@users.noreply.github.com> --- src/features/settings/__tests__/dotnetSettings.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/settings/__tests__/dotnetSettings.test.tsx b/src/features/settings/__tests__/dotnetSettings.test.tsx index e9799815c6..a382e45b0d 100644 --- a/src/features/settings/__tests__/dotnetSettings.test.tsx +++ b/src/features/settings/__tests__/dotnetSettings.test.tsx @@ -52,12 +52,12 @@ afterEach(() => { describe(".NET settings page", () => { it("shows the SDK in use, every installed one, and offers each version once", async () => { page({}); - await waitFor(() => expect(combo()).toHaveTextContent("Not pinned")); - expect(screen.getAllByRole("listitem").map((item) => item.textContent)).toEqual([ + expect((await screen.findAllByRole("listitem")).map((item) => item.textContent)).toEqual([ "11.0.100-rc.1.26425.101 · /usr/local/share/dotnet/sdk", "10.0.401 · /usr/local/share/dotnet/sdk", "10.0.401 · /work/app/.dotnet/sdk", ]); + expect(combo()).toHaveTextContent("Not pinned"); expect(alerts()).toEqual([]); fireEvent.click(combo()); expect(await screen.findAllByRole("option")).toHaveLength(2);