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

The vocabulary table covers the studio's lists, and stays ahead of the next page #147

Closed opened this
Closed without merging

scout/forge:scout/97-the-vocabulary-table-covers-the-studio-s → main 1 commit fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
2 files changed +105 −2
src/web/studio/lists.ts +1 −1
@@ -290,7 +290,7 @@ export async function studioChanges(
290290 </div>
291291 <p class="muted small mt">
292292 <a href="${base}/pulls?mode=dev">${icon("code")}See dev's list</a> —
293 branch names and the diff, dev's own way.
293 where each change lives and its diff, dev's own way.
294294 </p>
295295 ${liveMount({ repo: base })}`;
296296
test/studio-words.test.ts +104 −1
@@ -118,6 +118,7 @@ describe("dev's vocabulary never reaches a studio page", () => {
118118 let cookie: string;
119119 let record: AppRecord;
120120 let tellNumber: number;
121 let untouchedTitle: string;
121122 let runId: string;
122123 let openPullNumber: number;
123124 let mergedPullNumber: number;
@@ -206,6 +207,17 @@ describe("dev's vocabulary never reaches a studio page", () => {
206207 expect(addToCrew(app, a.value, repo, "scout").ok).toBe(true);
207208 const scoutUser = getUserByName(app.db, "scout")!;
208209
210 // A second tell nobody has touched — the issue list's own *told* bucket,
211 // since the one below is picked up by a run and a pull before the
212 // fixture is done, and would otherwise never prove `?word=told` narrows
213 // anything.
214 untouchedTitle = "List test: nobody has picked this up";
215 const untouched = openIssue(app, a.value, repo, {
216 title: untouchedTitle,
217 body: "still just said",
218 });
219 if (!untouched.ok) throw new Error(String(untouched.error));
220
209221 // A tell, assigned, with a run — the studio's *tell* and *working*.
210222 const told = openIssue(app, a.value, repo, {
211223 title: "Make the export button work",
@@ -326,7 +338,16 @@ describe("dev's vocabulary never reaches a studio page", () => {
326338 });
327339
328340 test("home, app, tell, working, look and shipped: no dev word, the studio chrome, the security floor, and a page a diff would never fit in", async () => {
329 const pages: { word: string; path: string }[] = [
341 // `contains`/`excludes` are optional, raw-HTML proof that a filtered or
342 // paged row is not vacuous — the same job the "search" case below does
343 // inline, generalised so a list's `?word=` and `cursor` rows can prove
344 // themselves without a second kind of test.
345 const pages: {
346 word: string;
347 path: string;
348 contains?: string;
349 excludes?: string;
350 }[] = [
330351 { word: "home", path: "/" },
331352 { word: "app", path: "/alice/vocab" },
332353 { word: "tell", path: `/alice/vocab/issues/${tellNumber}` },
@@ -336,6 +357,49 @@ describe("dev's vocabulary never reaches a studio page", () => {
336357 // A word from the app's own description, not its name — proving the
337358 // search reaches the description, not just a name match.
338359 { word: "search", path: "/search?q=catch" },
360 // Everything told, every change, every run (#95): the studio's three
361 // list pages — the plain path, a `?word=` filter and a `cursor` page
362 // of each, since those are the URLs a person actually lands on from
363 // the app page. A new studio page's row goes here too.
364 { word: "tells", path: "/alice/vocab/issues" },
365 {
366 word: "tells",
367 path: "/alice/vocab/issues?word=told",
368 contains: untouchedTitle,
369 excludes: "Make the export button work",
370 },
371 {
372 word: "tells",
373 // The exact cursor `/issues`'s own pager would hand back after the
374 // tell above — past it, only the untouched one is left.
375 path: `/alice/vocab/issues?cursor=${tellNumber}`,
376 contains: untouchedTitle,
377 excludes: "Make the export button work",
378 },
379 { word: "changes", path: "/alice/vocab/pulls" },
380 {
381 word: "changes",
382 path: "/alice/vocab/pulls?word=look",
383 contains: "Add the export button",
384 },
385 {
386 word: "changes",
387 // Past the only open change there is nothing left on this page.
388 path: `/alice/vocab/pulls?cursor=${openPullNumber}`,
389 excludes: "Add the export button",
390 },
391 { word: "runs", path: "/alice/vocab/runs" },
392 {
393 word: "runs",
394 path: "/alice/vocab/runs?word=working",
395 contains: `href="/alice/vocab/runs/${runId}"`,
396 },
397 {
398 word: "runs",
399 // Past the only agent run there is nothing left on this page.
400 path: `/alice/vocab/runs?cursor=${runId}`,
401 excludes: `href="/alice/vocab/runs/${runId}"`,
402 },
339403 ];
340404
341405 for (const p of pages) {
@@ -383,6 +447,18 @@ describe("dev's vocabulary never reaches a studio page", () => {
383447 // The search itself: "catch" is only in the app's description, never
384448 // its name, so finding it here proves the description is reached.
385449 if (p.word === "search") expect(visible).toContain("vocab");
450 if (p.contains !== undefined) {
451 expect(
452 html,
453 `${p.word} (${p.path}) is missing "${p.contains}" — the filter or cursor did nothing`,
454 ).toContain(p.contains);
455 }
456 if (p.excludes !== undefined) {
457 expect(
458 html,
459 `${p.word} (${p.path}) still has "${p.excludes}" — the filter or cursor did nothing`,
460 ).not.toContain(p.excludes);
461 }
386462 }
387463
388464 // A run id is a key, not a headline: it rides hrefs (the dev link, the
@@ -408,5 +484,32 @@ describe("dev's vocabulary never reaches a studio page", () => {
408484 ).text();
409485 expect(dev).toContain("diff-table");
410486 expect(dev).toContain(openBranch);
487
488 const devTells = await (
489 await fetch(`${base}/alice/vocab/issues?mode=dev`, {
490 headers: { cookie },
491 redirect: "manual",
492 })
493 ).text();
494 expect(devTells).toContain(`>#${tellNumber} opened`);
495 expect(devTells).not.toContain("data-word=");
496
497 const devChanges = await (
498 await fetch(`${base}/alice/vocab/pulls?mode=dev`, {
499 headers: { cookie },
500 redirect: "manual",
501 })
502 ).text();
503 expect(devChanges).toContain(openBranch);
504 expect(devChanges).not.toContain("data-word=");
505
506 const devRuns = await (
507 await fetch(`${base}/alice/vocab/runs?mode=dev`, {
508 headers: { cookie },
509 redirect: "manual",
510 })
511 ).text();
512 expect(devRuns).toContain("Done");
513 expect(devRuns).not.toContain("data-word=");
411514 });
412515 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs