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
scout/forge:scout/97-the-vocabulary-table-covers-the-studio-s → main 1 commit fork
2 files
changed +105
−2
src/web/studio/lists.ts +1 −1
| @@ -290,7 +290,7 @@ export async function studioChanges( | ||
| 290 | 290 | </div> |
| 291 | 291 | <p class="muted small mt"> |
| 292 | 292 | <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. | |
| 294 | 294 | </p> |
| 295 | 295 | ${liveMount({ repo: base })}`; |
| 296 | 296 |
test/studio-words.test.ts +104 −1
| @@ -118,6 +118,7 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 118 | 118 | let cookie: string; |
| 119 | 119 | let record: AppRecord; |
| 120 | 120 | let tellNumber: number; |
| 121 | let untouchedTitle: string; | |
| 121 | 122 | let runId: string; |
| 122 | 123 | let openPullNumber: number; |
| 123 | 124 | let mergedPullNumber: number; |
| @@ -206,6 +207,17 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 206 | 207 | expect(addToCrew(app, a.value, repo, "scout").ok).toBe(true); |
| 207 | 208 | const scoutUser = getUserByName(app.db, "scout")!; |
| 208 | 209 | |
| 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 | ||
| 209 | 221 | // A tell, assigned, with a run — the studio's *tell* and *working*. |
| 210 | 222 | const told = openIssue(app, a.value, repo, { |
| 211 | 223 | title: "Make the export button work", |
| @@ -326,7 +338,16 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 326 | 338 | }); |
| 327 | 339 | |
| 328 | 340 | 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 | }[] = [ | |
| 330 | 351 | { word: "home", path: "/" }, |
| 331 | 352 | { word: "app", path: "/alice/vocab" }, |
| 332 | 353 | { word: "tell", path: `/alice/vocab/issues/${tellNumber}` }, |
| @@ -336,6 +357,49 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 336 | 357 | // A word from the app's own description, not its name — proving the |
| 337 | 358 | // search reaches the description, not just a name match. |
| 338 | 359 | { 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 | }, | |
| 339 | 403 | ]; |
| 340 | 404 | |
| 341 | 405 | for (const p of pages) { |
| @@ -383,6 +447,18 @@ describe("dev's vocabulary never reaches a studio page", () => { | ||
| 383 | 447 | // The search itself: "catch" is only in the app's description, never |
| 384 | 448 | // its name, so finding it here proves the description is reached. |
| 385 | 449 | 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 | } | |
| 386 | 462 | } |
| 387 | 463 | |
| 388 | 464 | // 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", () => { | ||
| 408 | 484 | ).text(); |
| 409 | 485 | expect(dev).toContain("diff-table"); |
| 410 | 486 | 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="); | |
| 411 | 514 | }); |
| 412 | 515 | }); |
new above
offline