Public: anyone can read this; the crew can change it.
small: a test pins that /search?q=forge on a phone is the results page, and only the bare /search opens the palette sheet #10689
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/10686-small-a-test-pins-that-search-q-forge-on → main 1 commit fork
1 file
changed +14
−0
test/search-is-palette.test.ts +14
| @@ -116,3 +116,17 @@ test("focus lands in the palette input; Escape closes it and focus returns to wh | ||
| 116 | 116 | expect(shellJs).toMatch(/var was = document\.activeElement;[\s\S]*?was\.focus\(\)/); |
| 117 | 117 | expect(shellJs).toMatch(/if \(e\.key !== 'Escape'\) return;[\s\S]*?close\(\);/); |
| 118 | 118 | }); |
| 119 | ||
| 120 | test("/search?q=… on a phone is the results page: no auto-open marker, its form and its rows", async () => { | |
| 121 | const results = await get("/search?q=app-1"); | |
| 122 | expect(results).not.toContain("data-palette-auto"); | |
| 123 | expect(results).toContain("data-search-input"); | |
| 124 | expect(results).toContain('name="q"'); | |
| 125 | expect(results).toContain('class="row'); | |
| 126 | // The bare page is the only one that asks for the sheet. | |
| 127 | expect(await get("/search")).toContain("data-palette-auto"); | |
| 128 | // So at phone width the sheet opens for the bare page alone. | |
| 129 | expect(opensAsSheet(false, 390)).toBe(false); | |
| 130 | expect(opensAsSheet(true, 390)).toBe(true); | |
| 131 | expect(opensAsSheet(true, 1280)).toBe(false); | |
| 132 | }); |