test(settings): Wait for the Download JDK version list before checking the preselected version

This commit is contained in:
l0ng-ai committed 2026-10-29 01:13:24 +08:00
1 parent 1e9bba97e3
commit e59bc01e17
1 file changed
+2 -1
@@ -66,6 +66,7 @@ describe("Download JDK dialog", () => {
it("preselects the version a fix asks for", async () => {
render(<DownloadJdkDialog initialVersion={21} onClose={() => {}} onDownloaded={() => {}} />);
await waitFor(() => expect(screen.getByRole("button", { name: "Download" })).toBeEnabled());
expect(screen.getByRole("button", { name: "Version" })).toHaveTextContent("21");
// The version list loads after the Download button enables on a busy runner.
await waitFor(() => expect(screen.getByRole("button", { name: "Version" })).toHaveTextContent("21"));
});
});