Skip to content

The open-source app everyone uses to manage agents at work

test(ui): stabilize IssueProperties model-options assertion (#8299)

Nicky Leach7a311ca16f5e
diff --git a/ui/src/components/IssueProperties.test.tsx b/ui/src/components/IssueProperties.test.tsx
index 63f8d1eb13..f795978457 100644
--- a/ui/src/components/IssueProperties.test.tsx
+++ b/ui/src/components/IssueProperties.test.tsx
@@ -1059,9 +1059,13 @@ describe("IssueProperties", () => {
expect(container.textContent).toContain("Custom · gpt-5.4 · high");
expect(container.textContent).toContain("Model lane");
- const modelButton = Array.from(container.querySelectorAll("button"))
- .find((button) => button.textContent?.includes("GPT-5.5"));
- expect(modelButton).not.toBeUndefined();
+ // Wait for the adapter-models query to resolve so the model options render.
+ let modelButton: HTMLButtonElement | undefined;
+ await waitForAssertion(() => {
+ modelButton = Array.from(container.querySelectorAll("button"))
+ .find((button) => button.textContent?.includes("GPT-5.5"));
+ expect(modelButton).not.toBeUndefined();
+ });
await act(async () => {
modelButton!.dispatchEvent(new MouseEvent("click", { bubbles: true }));