refactoring, numbering plan
This commit is contained in:
1 parent
b5279434b2
commit
3b04039aa9
47 files changed
+3485
-953
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import {
|
||||
clearPendingFiles,
|
||||
queuePendingFiles,
|
||||
takePendingFiles
|
||||
} from '../../src/lib/pending-files';
|
||||
|
||||
const pdf = () => new File(['%PDF-1.7'], 'akte.pdf', { type: 'application/pdf' });
|
||||
const zip = () => new File(['PK'], 'archiv.zip', { type: 'application/zip' });
|
||||
|
||||
test.beforeEach(() => clearPendingFiles());
|
||||
|
||||
test('a target only receives the files queued for it', () => {
|
||||
queuePendingFiles([zip()], 'bea');
|
||||
queuePendingFiles([pdf()], 'pagination');
|
||||
|
||||
const paginationFiles = takePendingFiles('pagination');
|
||||
|
||||
expect(paginationFiles.map((file) => file.name)).toEqual(['akte.pdf']);
|
||||
// The beA handoff must survive a pagination visit instead of being dropped.
|
||||
expect(takePendingFiles('bea').map((file) => file.name)).toEqual(['archiv.zip']);
|
||||
});
|
||||
|
||||
test('taking a target clears only that target', () => {
|
||||
queuePendingFiles([pdf(), pdf()], 'pagination');
|
||||
|
||||
expect(takePendingFiles('pagination')).toHaveLength(2);
|
||||
expect(takePendingFiles('pagination')).toHaveLength(0);
|
||||
});
|
||||
Reference in new issue
Block a user