Skip to content

Commit 153d431

Browse files
committed
test(tui): lock meta sign-in prefill against api-key slugs
1 parent 441eb0e commit 153d431

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎src/tui/provider-setup.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,23 @@ describe("runProviderSetup sign-in", () => {
10991099
expect(await done).toBe(false);
11001100
});
11011101

1102+
test("a suggested Meta name skips an existing API-key slug", async () => {
1103+
const { start } = stagedLoginStarter();
1104+
const { done, harness } = await mountConfig({
1105+
startLogin: start,
1106+
listOAuthProfiles: async () => [],
1107+
existingProviderNames: ["meta-api/default"],
1108+
});
1109+
await pickRow(harness, PROVIDER_IDS, "meta");
1110+
await flush(harness);
1111+
const frame = harness.captureCharFrame();
1112+
expect(frame).toContain("step 2 of 4");
1113+
expect(frame).toContain("default-2");
1114+
expect(frame.replaceAll("default-2", "")).not.toContain("default");
1115+
harness.pressKey("Ctrl+C");
1116+
expect(await done).toBe(false);
1117+
});
1118+
11021119
test("reusing a connected account's name asks to confirm before re-authorizing it", async () => {
11031120
const seenProfiles: string[] = [];
11041121
const { start } = stagedLoginStarter({

0 commit comments

Comments
 (0)