Open the epub import card and load a dropped file

This commit is contained in:
tim
2026-09-27 23:38:28 +02:00
parent 03ed1a69cb
commit 1246816ab8
3 changed files with 30 additions and 6 deletions
+10
View File
@@ -144,6 +144,16 @@ for (const storyId of [undefined, 1]) {
});
}
test('dropping a file on a closed epub import card opens it and fills the file field', () => {
const root = epubImport(1);
assert.equal(root.open, undefined);
const file = field(root, 'Epub file');
const book = new File(['book'], 'story.epub', { type: 'application/epub+zip' });
root.listeners.drop({ preventDefault() {}, dataTransfer: { files: [book] } });
assert.equal(root.open, true);
assert.equal(file.files[0], book);
});
test('library import sends only selected books and handles an empty candidate list', async () => {
await mountStories();
api.on('GET', 'library/candidates', []);