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

Full suite red: test/snapshot.test.ts #17703

opened this in answer to

Merged 12h 14m ago, live in production

scout/forge:scout/17701-full-suite-red-test-snapshot-test-ts → main 0 commits fork

  • Merged. scout/17701-full-suite-red-test-snapshot-test-ts was merged into main as e174c35.

Review

Sign in to review this change.
1 file changed +34 −11
test/snapshot.test.ts +34 −11
@@ -354,23 +354,36 @@ describe("a forge back from a snapshot", () => {
354354 );
355355 });
356356
357 test("the backups page: nowhere to put them says so; with a store, the list and the button", async () => {
357 /** Alice's session cookie: one password hash for the whole block, not one a test. */
358 let aliceCookie: Promise<string> | undefined;
359 const signIn = (servers: Servers): Promise<string> =>
360 (aliceCookie ??= fetch(`${servers.url}/signin`, {
361 method: "POST",
362 headers: { origin: servers.url },
363 body: new URLSearchParams({
364 username: "alice",
365 password: "a-good-passphrase",
366 }),
367 redirect: "manual",
368 }).then((r) => (r.headers.get("set-cookie") ?? "").split(";")[0]!));
369
370 test("the backups page: nowhere to put them says so", async () => {
358371 const servers: Servers = await serve(app);
359372 try {
360 const signedIn = await fetch(`${servers.url}/signin`, {
361 method: "POST",
362 headers: { origin: servers.url },
363 body: new URLSearchParams({
364 username: "alice",
365 password: "a-good-passphrase",
366 }),
367 redirect: "manual",
368 });
369 const cookie = (signedIn.headers.get("set-cookie") ?? "").split(";")[0]!;
373 const cookie = await signIn(servers);
370374 const none = await (
371375 await fetch(`${servers.url}/settings/backups`, { headers: { cookie } })
372376 ).text();
373377 expect(none).toContain("No snapshots are taken");
378 } finally {
379 servers.stop();
380 }
381 });
382
383 test("the backups page: with a store, the list and the button", async () => {
384 const servers: Servers = await serve(app);
385 try {
386 const cookie = await signIn(servers);
374387 const { store } = await snapshotted();
375388 const svc = startSnapshots(app, store, {
376389 version: "t",
@@ -405,6 +418,16 @@ describe("a forge back from a snapshot", () => {
405418 } finally {
406419 await svc.stop();
407420 }
421 } finally {
422 servers.stop();
423 }
424 });
425
426 test("the backups page: with a passphrase it names the variable; a stranger sees nothing", async () => {
427 const servers: Servers = await serve(app);
428 try {
429 const cookie = await signIn(servers);
430 const { store } = await snapshotted();
408431 const wrapping = startSnapshots(app, store, {
409432 version: "t",
410433 nightly: false,

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs