Skip to content

Commit 985bb56

Browse files
committed
Minor fix and added missing test
1 parent 3cb897b commit 985bb56

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/routes/projects/[projectId]/workflows/experimental/[workflowId]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@
731731
<i class="bi-journal-code" /> List jobs
732732
</a>
733733
<button class="btn btn-light" on:click|preventDefault={handleExportWorkflow}>
734-
<i class="bi-box-arrow-up" />
734+
<i class="bi-download" />
735735
</button>
736736
<a id="downloadWorkflowButton" class="d-none">Download workflow link</a>
737737
<button

tests/jschema.spec.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,22 @@ test('JSON Schema validation', async ({ page, browserName, workflow }) => {
279279
expect(exportedData.requiredObject.referencedRequiredNestedObject.optionalMax).toEqual(5);
280280
});
281281

282-
await test.step('Attempt to import invalid file', async () => {
282+
await test.step('Attempt to import a file containing invalid JSON', async () => {
283+
await page.getByRole('button', { name: 'Import' }).click();
284+
const modalTitle = page.locator('.modal.show .modal-title');
285+
await modalTitle.waitFor();
286+
await expect(modalTitle).toHaveText('Import arguments');
287+
const fileChooserPromise = page.waitForEvent('filechooser');
288+
await page.getByText('Select arguments file').click();
289+
const fileChooser = await fileChooserPromise;
290+
await fileChooser.setFiles(path.join(__dirname, 'data', 'broken.json'));
291+
await page.getByRole('button', { name: 'Confirm' }).click();
292+
await page.getByText("File doesn't contain valid JSON").waitFor();
293+
await page.getByRole('button', { name: 'Close' }).click();
294+
await waitModalClosed(page);
295+
});
296+
297+
await test.step('Attempt to import a file containing invalid arguments', async () => {
283298
const invalidData = { ...exportedData, requiredEnum: 'invalid' };
284299
fs.writeFileSync(downloadedFile, JSON.stringify(invalidData));
285300
await page.getByRole('button', { name: 'Import' }).click();

0 commit comments

Comments
 (0)