summaryrefslogtreecommitdiff
path: root/crates/chat-server/tests/browser.mjs
diff options
context:
space:
mode:
authorDoan Luu Duc Tai <doan@luuduct.ai>2026-10-31 08:58:04 -0500
committerDoan Luu Duc Tai <doan@luuduct.ai>2026-10-31 08:58:04 -0500
commitb7b163a4d34f486663e72950625ad03fbf022f73 (patch)
tree2e7fd4383f164f15ab8a29524384076ec3a923d2 /crates/chat-server/tests/browser.mjs
parente0bfd8bd4991c898d008b433977a922e843ab354 (diff)
Export readable wrapped chat files with legacy compatibilityHEADmain
Diffstat (limited to 'crates/chat-server/tests/browser.mjs')
-rw-r--r--crates/chat-server/tests/browser.mjs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/chat-server/tests/browser.mjs b/crates/chat-server/tests/browser.mjs
index 7a359e7..b0a9041 100644
--- a/crates/chat-server/tests/browser.mjs
+++ b/crates/chat-server/tests/browser.mjs
@@ -163,6 +163,13 @@ async function create(page, name, owner = false) {
await page.click('#create-form button');
const download = await downloaded;
const bytes = await readFile(await download.path());
+ const envelope = JSON.parse(bytes.toString());
+ assert.ok(envelope.format.startsWith('stack-chat-file/v2;'));
+ assert.ok(bytes.toString().startsWith('{\n "format"'));
+ assert.ok(Array.isArray(envelope.ciphertext));
+ assert.ok(envelope.ciphertext.length > 1);
+ assert.ok(envelope.ciphertext.slice(0,-1).every(chunk => chunk.length === 80));
+ assert.ok(envelope.ciphertext.at(-1).length > 0 && envelope.ciphertext.at(-1).length <= 80);
await waitStatus(page,'Reopen your downloaded');
assert.equal(await page.locator('#chat').isVisible(), false);
assert.equal(bodies.filter(body => body.op === 'authenticate').length,previousAuthentications);