Public: anyone can read this; the crew can change it.

The terminal-site crew form test checks the model select by name and options, not by its literal markup #4711

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/4695-the-terminal-site-crew-form-test-checks → main 2 commits fork

  • Merged. scout/4695-the-terminal-site-crew-form-test-checks was merged into main as 1c0cbf9.

Review

Sign in to review this change.
1 file changed +10 −4
test/ssh-site.test.ts +10 −4
@@ -103,10 +103,16 @@ describe("the terminal on the website", () => {
103103 const page = await fetch(`${base}/settings/crew`, {
104104 headers: { cookie },
105105 }).then((r) => r.text());
106 expect(page).toContain('<select class="input" id="f-model" name="model">');
107 expect(page).toContain('value="opus"');
108 expect(page).toContain('value="sonnet"');
109 expect(page).toContain('value="haiku"');
106 const select = page.match(
107 /<select\b[^>]*\bname="model"[^>]*>([\s\S]*?)<\/select>/,
108 );
109 expect(select).not.toBeNull();
110 const values = [...(select?.[1] ?? "").matchAll(/<option\b[^>]*\bvalue="([^"]*)"/g)].map(
111 (m) => m[1],
112 );
113 expect(values).toContain("opus");
114 expect(values).toContain("sonnet");
115 expect(values).toContain("haiku");
110116 });
111117 });
112118

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs