From b7b163a4d34f486663e72950625ad03fbf022f73 Mon Sep 17 00:00:00 2001 From: Doan Luu Duc Tai Date: Sat, 31 Oct 2026 08:58:04 -0500 Subject: Export readable wrapped chat files with legacy compatibility --- crates/chat-server/tests/browser.mjs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/chat-server/tests') 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); -- cgit v1.2.3