test(FN-4673): complete Step 3 — update copilot device-code assertions

Fusion-Task-Id: FN-4673
Fusion-Task-Lineage: 165601b1-c20c-40d5-addb-3c42d710d66d
This commit is contained in:
Fusion
2026-05-15 15:07:17 -07:00
committed by gsxdsm
parent da339cf3ce
commit 03c49a6d49
2 changed files with 9 additions and 0 deletions

View File

@@ -881,9 +881,13 @@ describe("ModelOnboardingModal", () => {
expect(await within(copilotCard).findByText("ABCD-1234")).toBeTruthy();
expect(within(copilotCard).queryByTestId("onboarding-login-instructions-github-copilot")).toBeNull();
expect(mockWindowOpen).not.toHaveBeenCalled();
expect(writeText).toHaveBeenCalledWith("ABCD-1234");
expect(writeText).toHaveBeenCalledTimes(1);
fireEvent.click(within(copilotCard).getByRole("button", { name: "Copy code" }));
expect(writeText).toHaveBeenCalledWith("ABCD-1234");
expect(writeText).toHaveBeenCalledTimes(2);
fireEvent.click(within(copilotCard).getByRole("button", { name: "Open GitHub" }));
expect(mockWindowOpen).toHaveBeenCalledWith("https://github.com/login/device", "_blank");

View File

@@ -1732,8 +1732,13 @@ describe("SettingsModal", () => {
expect(await within(copilotCard).findByText("ABCD-1234")).toBeInTheDocument();
expect(within(copilotCard).queryByTestId("auth-login-instructions-github-copilot")).not.toBeInTheDocument();
expect(openSpy).not.toHaveBeenCalled();
expect(writeText).toHaveBeenCalledWith("ABCD-1234");
expect(writeText).toHaveBeenCalledTimes(1);
await userEvent.click(within(copilotCard).getByRole("button", { name: "Copy code" }));
expect(writeText).toHaveBeenCalledWith("ABCD-1234");
expect(writeText).toHaveBeenCalledTimes(2);
await userEvent.click(within(copilotCard).getByRole("button", { name: "Open GitHub" }));
expect(openSpy).toHaveBeenCalledWith("https://github.com/login/device", "_blank");