diff --git a/browser_tests/tests/dialogs/modelImportProgressDialog.spec.ts b/browser_tests/tests/dialogs/modelImportProgressDialog.spec.ts index e5ac4c86c77..2c574bf6365 100644 --- a/browser_tests/tests/dialogs/modelImportProgressDialog.spec.ts +++ b/browser_tests/tests/dialogs/modelImportProgressDialog.spec.ts @@ -175,7 +175,7 @@ test.describe('Model import progress toast', { tag: ['@screenshot'] }, () => { await expect( toast.getByText('Cancelled', { exact: true }).first() ).toBeVisible() - await expect(toast.getByRole('button', { name: 'Close' })).toBeHidden() + await expect(toast.getByRole('button', { name: 'Close' })).toBeVisible() }) await test.step('keep the terminal backend state rendered', async () => { @@ -238,7 +238,7 @@ test.describe('Model import progress toast', { tag: ['@screenshot'] }, () => { await expect( toast.getByText('Cancelled', { exact: true }).first() ).toBeVisible() - await expect(toast.getByRole('button', { name: 'Close' })).toBeHidden() + await expect(toast.getByRole('button', { name: 'Close' })).toBeVisible() }) await test.step('settle the cancellation once the task lookup 404s', async () => { diff --git a/src/platform/assets/components/ModelImportProgressDialog.test.ts b/src/platform/assets/components/ModelImportProgressDialog.test.ts index 9a411f22612..7c3a24e9bca 100644 --- a/src/platform/assets/components/ModelImportProgressDialog.test.ts +++ b/src/platform/assets/components/ModelImportProgressDialog.test.ts @@ -75,14 +75,17 @@ describe('ModelImportProgressDialog cancellation', () => { }) }) - it('keeps provisional cancellations open for authoritative reconciliation', async () => { + it('allows a provisional cancellation to be dismissed', async () => { + const user = userEvent.setup() const store = renderDialog() store.downloadList[0].status = 'cancellation_pending' await nextTick() - expect(screen.queryByRole('button', { name: 'Close' })).toBeNull() - expect(screen.getAllByText('Cancelled')).not.toHaveLength(0) + await user.click(screen.getByRole('button', { name: 'Close' })) + + await waitFor(() => expect(store.hasDownloads).toBe(false)) + expect(screen.queryByRole('status')).toBeNull() }) it('restores the close control once a cancellation settles', async () => { @@ -90,7 +93,7 @@ describe('ModelImportProgressDialog cancellation', () => { store.downloadList[0].status = 'cancellation_pending' await nextTick() - expect(screen.queryByRole('button', { name: 'Close' })).toBeNull() + expect(screen.getByRole('button', { name: 'Close' })).toBeVisible() // The store bounds how long a cancellation stays provisional, so the // dialog cannot be pinned open without a close control until a reload. diff --git a/src/platform/assets/components/ModelImportProgressDialog.vue b/src/platform/assets/components/ModelImportProgressDialog.vue index cc9f8ce608a..e6c3d891e03 100644 --- a/src/platform/assets/components/ModelImportProgressDialog.vue +++ b/src/platform/assets/components/ModelImportProgressDialog.vue @@ -93,7 +93,7 @@ const activeFilterLabel = computed(() => { }) function closeDialog() { - assetDownloadStore.clearFinishedDownloads() + assetDownloadStore.clearDismissibleDownloads() isExpanded.value = false } @@ -279,7 +279,7 @@ async function cancelDownload(taskId: TaskId) {