The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 18:30 UTC
test(web): split the cloud voice cancel flow from the failed-then-saved setup (#35665)
Julius Marminge committed
Nov 12, 2026 at 14:57 UTC
bce2bc048ecd75e7d60a6f2af7db10fe20befdb7
1 file changed
+27
-6
apps/web/src/components/settings/CloudVoiceConfiguration.browser.test.tsx
+27
-6
@@ -84,6 +84,33 @@ async function withVoicePanel(
84
);
85
}
86
87
+it("cancelling a provider's setup keeps the current destination and writes nothing", async () => {
88
+ chooseAudioDestination({ kind: "environment", environmentId: id });
89
+ const writes: unknown[] = [];
90
+ await withVoicePanel(
91
+ (url, request, init) => {
92
+ if (url.pathname === "/api/voice/cloud/keys")
93
+ return Promise.resolve(Response.json({ openai: false, xai: true }));
94
+ if (url.pathname !== "/api/voice/cloud/openai/key") return null;
95
+ return new Request(request, init).json().then((body) => {
96
+ writes.push(body);
97
+ return new Response(null, { status: 204 });
98
+ });
99
+ },
100
+ async (screen) => {
101
+ const destination = screen.getByRole("combobox", { name: "Transcribe with" });
102
+ await expect.element(destination).toHaveTextContent("Laptop");
103
+ await destination.click();
104
+ await page.getByRole("option", { name: "OpenAI via Laptop" }).click();
105
+ const dialog = page.getByRole("dialog");
106
+ await dialog.getByRole("button", { name: "Cancel" }).click();
107
+ await expect.element(dialog).not.toBeInTheDocument();
108
+ await expect.element(destination).toHaveTextContent("Laptop");
109
+ expect(writes).toEqual([]);
110
+ },
111
+ );
112
+});
113
+
114
it("enables the chosen provider only after a successful setup", async () => {
115
chooseAudioDestination({ kind: "environment", environmentId: id });
116
const writes: unknown[] = [];
@@ -104,15 +131,9 @@ it("enables the chosen provider only after a successful setup", async () => {
131
},
132
async (screen) => {
133
const destination = screen.getByRole("combobox", { name: "Transcribe with" });
107
- await expect.element(destination).toHaveTextContent("Laptop");
134
await destination.click();
135
await page.getByRole("option", { name: "OpenAI via Laptop" }).click();
136
const dialog = page.getByRole("dialog");
111
- await dialog.getByRole("button", { name: "Cancel" }).click();
112
- await expect.element(destination).toHaveTextContent("Laptop");
113
- expect(writes).toEqual([]);
114
- await destination.click();
115
- await page.getByRole("option", { name: "OpenAI via Laptop" }).click();
137
await dialog.getByRole("combobox", { name: "OpenAI API key source" }).click();
138
await page.getByRole("option", { name: "Work vault" }).click();
139
await dialog.getByLabelText("OpenAI API key reference").fill("op://Work/Voice/key");