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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4695-the-terminal-site-crew-form-test-checks → main 2 commits fork
1 file
changed +10
−4
test/ssh-site.test.ts +10 −4
| @@ -103,10 +103,16 @@ describe("the terminal on the website", () => { | ||
| 103 | 103 | const page = await fetch(`${base}/settings/crew`, { |
| 104 | 104 | headers: { cookie }, |
| 105 | 105 | }).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"); | |
| 110 | 116 | }); |
| 111 | 117 | }); |
| 112 | 118 |
new above
offline