Open the epub import card and load a dropped file
This commit is contained in:
@@ -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', []);
|
||||
|
||||
Reference in New Issue
Block a user