Import: downloadable Word template for the session list
Build and Push Docker Image / build-and-push (push) Failing after 20s
Build and Push Docker Image / build-and-push (push) Failing after 20s
A blank three-column session list (Session #, Title, Passage) with instructions and example rows, built in the browser on demand. A test imports the generated file back through the real importer. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7a010fcda8
commit
ec59f7c82d
4 files changed
+136
-1
No files matched your search
+15
-1
@@ -541,7 +541,7 @@ describe('Import page', () => {
|
||||
expect(await screen.findByRole('heading', { name: /import session list/i })).toBeInTheDocument();
|
||||
expect(screen.queryByRole('option', { name: 'KJV' })).not.toBeInTheDocument();
|
||||
expect(screen.getByText(/Berean Standard Bible/)).toBeInTheDocument();
|
||||
await user.click(screen.getByRole('button', { name: /back/i }));
|
||||
await user.click(screen.getByRole('button', { name: /^back$/i }));
|
||||
expect(await screen.findByRole('button', { name: /import session list/i })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -1391,3 +1391,17 @@ describe('Resizable study column', () => {
|
||||
expect(columns().style.getPropertyValue('--study-right')).toBe('560px');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Import template', () => {
|
||||
test('the Import page offers a Word template to download', async () => {
|
||||
const user = userEvent.setup();
|
||||
await renderApp();
|
||||
await user.click(screen.getByRole('button', { name: /import session list/i }));
|
||||
await user.click(await screen.findByRole('button', { name: /download template/i }));
|
||||
await waitFor(() => expect(URL.createObjectURL).toHaveBeenCalled());
|
||||
const blob = URL.createObjectURL.mock.calls.at(-1)[0];
|
||||
expect(blob.type).toMatch(/wordprocessingml/);
|
||||
// and the button comes back to normal afterwards
|
||||
expect(await screen.findByRole('button', { name: /download template/i })).toBeEnabled();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user