{"draft":null,"from":57,"to":58,"files":[{"path":"client/test/box.test.ts","added":24,"removed":0,"diff":"--- a/client/test/box.test.ts\n+++ b/client/test/box.test.ts\n@@ -91,6 +91,7 @@\n \t);\n \tassert.deepEqual(said, [\n \t\t\"To sign this box in, open https://abso.dev/login/box?code=WXYZ-BCDF and approve the code WXYZ-BCDF.\",\n+\t\t\"Waiting for approval. Ctrl-C stops waiting, and abso stops by itself when the code runs out.\",\n \t]);\n \tassert.equal(readBox(SERVER, h)?.credential, CREDENTIAL);\n \tconst files = readdirSync(join(h, \".abso\", \"boxes\"));\n@@ -160,6 +161,29 @@\n \tassert.equal(readBox(SERVER, h), undefined);\n });\n \n+test(\"login says it's still waiting about once a minute, and stops in the end whatever the server says\", async () => {\n+\tconst c = clock();\n+\tconst said: string[] = [];\n+\tconst pending = Array.from({ length: 2000 }, (): [number, unknown] => [400, { error: \"authorization_pending\" }]);\n+\tawait assert.rejects(\n+\t\tlogin(\n+\t\t\tSERVER,\n+\t\t\t{\n+\t\t\t\tfetch: server([[200, { ...started, expires_in: 10 ** 9, interval: 5 }], ...pending], []),\n+\t\t\t\tsleep: c.sleep,\n+\t\t\t\tnow: c.now,\n+\t\t\t\tsay: (line) => said.push(line),\n+\t\t\t},\n+\t\t\thome(),\n+\t\t),\n+\t\t/nobody approved the code WXYZ-BCDF in time\\. Run abso login again\\./,\n+\t);\n+\tassert.equal(c.slept(), 30 * 60 * 1000, \"a server that says never still gets an end\");\n+\tconst still = said.filter((line) => line === \"Still waiting for the code WXYZ-BCDF to be approved.\");\n+\tassert.equal(still.length, 30);\n+\tassert.equal(said.length, 2 + 30);\n+});\n+\n test(\"a key is minted with the box credential, sent only to the box's own server\", async () => {\n \tconst seen: Seen = [];\n \tconst minted = await mintKey("}],"unmatched":[]}