Skip to content

Commit 1589c6f

Browse files
committed
Selected first task also in 'Restart workflow' modal
1 parent edbb7cc commit 1589c6f

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

src/lib/components/v2/workflow/RunWorkflowModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
mode = action;
4242
replaceExistingDataset = true;
4343
workerInitControl = '';
44-
if (mode === 'run' && workflow.task_list.length > 0) {
44+
if ((mode === 'run' || mode === 'restart') && workflow.task_list.length > 0) {
4545
firstTaskIndex = 0;
4646
} else {
4747
firstTaskIndex = undefined;

tests/v2/run_mock_tasks.spec.js

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,16 @@ test('Collect and run mock tasks [v2]', async ({ page, workflow, request }) => {
137137
await page.getByRole('button', { name: 'Run workflow' }).click();
138138
const modal = page.locator('.modal.show');
139139
await modal.waitFor();
140-
await expect(modal.getByRole('combobox', { name: 'Dataset', exact: true })).toHaveValue(
141-
datasetId1.toString()
142-
);
140+
await expect(
141+
modal
142+
.getByRole('combobox', { name: 'Dataset', exact: true })
143+
.getByRole('option', { selected: true })
144+
).toHaveText(datasetName1);
145+
await expect(
146+
modal
147+
.getByRole('combobox', { name: 'First task (Optional)' })
148+
.getByRole('option', { selected: true })
149+
).toHaveText('create_ome_zarr_compound');
143150
await page.getByRole('button', { name: 'Run', exact: true }).click();
144151
await page.getByRole('button', { name: 'Confirm' }).click();
145152
await waitModalClosed(page);
@@ -221,11 +228,16 @@ test('Collect and run mock tasks [v2]', async ({ page, workflow, request }) => {
221228
await page.getByRole('button', { name: 'Continue workflow' }).click();
222229
const modal = page.locator('.modal.show');
223230
await modal.waitFor();
224-
await page
231+
await expect(
232+
modal
233+
.getByRole('combobox', { name: 'First task (Optional)' })
234+
.getByRole('option', { selected: true })
235+
).toHaveText('Select first task');
236+
await modal
225237
.getByRole('combobox', { name: 'First task (Optional)' })
226238
.selectOption('generic_task');
227-
await page.getByRole('button', { name: 'Run', exact: true }).click();
228-
await page.getByRole('button', { name: 'Confirm' }).click();
239+
await modal.getByRole('button', { name: 'Run', exact: true }).click();
240+
await modal.getByRole('button', { name: 'Confirm' }).click();
229241
await waitModalClosed(page);
230242
});
231243

@@ -247,8 +259,13 @@ test('Collect and run mock tasks [v2]', async ({ page, workflow, request }) => {
247259
await page.getByRole('button', { name: 'Restart workflow' }).click();
248260
const modal = page.locator('.modal.show');
249261
await modal.waitFor();
250-
await page.getByRole('button', { name: 'Run', exact: true }).click();
251-
await page.getByRole('button', { name: 'Confirm' }).click();
262+
await expect(
263+
modal
264+
.getByRole('combobox', { name: 'First task (Optional)' })
265+
.getByRole('option', { selected: true })
266+
).toHaveText('create_ome_zarr_compound');
267+
await modal.getByRole('button', { name: 'Run', exact: true }).click();
268+
await modal.getByRole('button', { name: 'Confirm' }).click();
252269
await waitModalClosed(page);
253270
});
254271

0 commit comments

Comments
 (0)