feat: add product archive frontend client
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import test from 'node:test';
|
||||
|
||||
test('design preview serializes the complete visible document before PNG upload', async () => {
|
||||
const source = await readFile(new URL('../src/lib/designPreview.ts', import.meta.url), 'utf8');
|
||||
|
||||
assert.match(source, /serializeDocument\(document, stickers, \{ includeBackground: true \}\)/);
|
||||
assert.match(source, /canvas\.toBlob/);
|
||||
});
|
||||
|
||||
test('archive client submits document JSON and a PNG preview as multipart data', async () => {
|
||||
const source = await readFile(new URL('../src/lib/productArchive.ts', import.meta.url), 'utf8');
|
||||
|
||||
assert.match(source, /form\.append\('document_json'/);
|
||||
assert.match(source, /form\.append\('preview'/);
|
||||
});
|
||||
Reference in New Issue
Block a user