diff --git a/tests/e2e/conference-room-typing-intro.spec.ts b/tests/e2e/conference-room-typing-intro.spec.ts
index e251a62946a..d43284232a5 100644
--- a/tests/e2e/conference-room-typing-intro.spec.ts
+++ b/tests/e2e/conference-room-typing-intro.spec.ts
@@ -144,7 +144,7 @@ test.describe("Chat launch after onboarding wizard", () => {
await runOnboardingWizard(page, companyName, { source: /Claude/, complete: async () => {
const code = page.getByRole("textbox", { name: "Authorization code", exact: true });
await expect(code).toBeVisible({ timeout: 20_000 });
- await expect(page.getByRole("link", { name: "Sign in", exact: true })).toBeVisible();
+ await expect(page.getByRole("button", { name: "Sign in", exact: true })).toBeVisible();
await expect(page.getByRole("button", { name: "Next", exact: true })).toBeDisabled();
await expect(page.getByRole("button", { name: "Connect", exact: true })).toHaveCount(0);
await code.evaluate(input => {
diff --git a/tests/e2e/onboarding-resume.spec.ts b/tests/e2e/onboarding-resume.spec.ts
index 9af9bf635e0..203ffd13bde 100644
--- a/tests/e2e/onboarding-resume.spec.ts
+++ b/tests/e2e/onboarding-resume.spec.ts
@@ -196,11 +196,11 @@ test.describe("Onboarding wizard", () => {
await source.click();
const cardInstruction = page.getByText("Return to this window and enter the authorization code.");
- const authorizationLink = page.getByRole("link", { name: "Sign in", exact: true });
+ const signInButton = page.getByRole("button", { name: "Sign in", exact: true });
await expect(cardInstruction).toBeVisible({ timeout: 30_000 });
- await expect(authorizationLink).toBeVisible({ timeout: 15_000 });
- await expect(authorizationLink).toHaveAttribute("href", AUTHORIZATION_URL);
+ await expect(signInButton).toBeVisible({ timeout: 15_000 });
+ await expect(signInButton).toBeEnabled();
expect(startCalls).toBe(1);
const companiesRes = await page.request.get("/api/companies");
@@ -238,8 +238,8 @@ test.describe("Onboarding wizard", () => {
await expect(page.getByTestId("onboarding-wizard").getByText("Ada", { exact: true })).toBeVisible();
await expect(page.getByRole("radio", { name: "Claude Subscription", exact: true })).toBeChecked();
await expect(cardInstruction).toBeVisible({ timeout: 15_000 });
- await expect(authorizationLink).toBeVisible({ timeout: 15_000 });
- await expect(authorizationLink).toHaveAttribute("href", AUTHORIZATION_URL);
+ await expect(signInButton).toBeVisible({ timeout: 15_000 });
+ await expect(signInButton).toBeEnabled();
await expect.poll(readDraft).toMatchObject(resumedSelection);
expect(startCalls, "reopening must resume the session without a second source choice").toBe(1);
expect(hireCalls, "a pending login must not hire an agent").toBe(0);
diff --git a/tests/e2e/onboarding.spec.ts b/tests/e2e/onboarding.spec.ts
index cae3be267ff..99b56d0c873 100644
--- a/tests/e2e/onboarding.spec.ts
+++ b/tests/e2e/onboarding.spec.ts
@@ -399,9 +399,9 @@ test.describe("Onboarding wizard", () => {
await source.click();
await expect(cardInstruction).toBeVisible({ timeout: 30_000 });
- const cardLink = page.getByRole("link", { name: "Sign in", exact: true });
- await expect(cardLink).toBeVisible({ timeout: 15_000 });
- await expect(cardLink).toHaveAttribute("href", /claude\.ai\/oauth\/authorize/);
+ const signInButton = page.getByRole("button", { name: "Sign in", exact: true });
+ await expect(signInButton).toBeVisible({ timeout: 15_000 });
+ await expect(signInButton).toBeEnabled();
await expect.poll(() => persistedAgentStatus).toBe(200);
const persisted = await page.request.get(`/api/agents/${persistedAgentId}`);
expect(persisted.ok()).toBe(true);
diff --git a/ui/src/components/AdapterLoginChrome.test.tsx b/ui/src/components/AdapterLoginChrome.test.tsx
index 5afef715778..03a2d577928 100644
--- a/ui/src/components/AdapterLoginChrome.test.tsx
+++ b/ui/src/components/AdapterLoginChrome.test.tsx
@@ -90,12 +90,11 @@ describe("the connect step's cards", () => {
);
render(card());
- flushSync(() => container.querySelector("a")!.click());
+ flushSync(() => container.querySelector("button")!.click());
expect(open).toHaveBeenCalledOnce();
expect(container.querySelector("button")?.disabled).toBe(true);
expect(container.textContent).toContain(waitingLabel);
- const reopen = container.querySelector(`a[aria-label="Reopen ${providerName} sign-in"]`);
- expect(reopen?.getAttribute("href")).toBe("https://example.test/login");
+ expect(container.querySelector("a")).toBeNull();
expect(container.querySelector("input")?.disabled).toBe(false);
flushSync(() => root!.render(card("expired")));
expect(container.textContent).toContain("Your setup is saved.");
@@ -104,7 +103,24 @@ describe("the connect step's cards", () => {
button.click();
expect(retry).toHaveBeenCalledOnce();
flushSync(() => root!.render(card()));
- expect(container.querySelector("a")?.textContent).toBe("Sign in");
+ expect(container.querySelector("button")?.textContent).toBe("Sign in");
+ });
+
+ it("opens the provider URL from the sign-in button without a caller handler", () => {
+ const open = vi.spyOn(window, "open").mockReturnValue(null);
+ try {
+ render(
+ }>
+ {null}
+ ,
+ );
+ flushSync(() => container.querySelector("button")!.click());
+ expect(open).toHaveBeenCalledWith("https://example.test/login", "_blank", "noopener,noreferrer");
+ expect(container.querySelector("a")).toBeNull();
+ } finally {
+ open.mockRestore();
+ }
});
it("gives every card field the same input, from one declaration", () => {
diff --git a/ui/src/components/AdapterLoginChrome.tsx b/ui/src/components/AdapterLoginChrome.tsx
index bcb5d57b64f..90cd2f296d5 100644
--- a/ui/src/components/AdapterLoginChrome.tsx
+++ b/ui/src/components/AdapterLoginChrome.tsx
@@ -510,12 +510,7 @@ export function ProviderSubscriptionCard({
return (
- 1. {waiting ? (
-
- {signInInstruction}
-
- ) : signInInstruction}{mode === "submitted_code" && " and copy the authorization code"}.
+ 1. {signInInstruction}{mode === "submitted_code" && " and copy the authorization code"}.
2. {mode === "submitted_code" ? "Return to this window and enter the authorization code." : "Enter the code below in the sign-in window."}
}>
@@ -525,16 +520,13 @@ export function ProviderSubscriptionCard({
{mode === "submitted_code" ? "Waiting for code…" : "Waiting…"}
- ) :