Skip to content

Commit 1d34f3a

Browse files
committed
refactor(tests): drop unrelated state-manifest timeout change and centralize SESSION_SAVE_TIMEOUT
1 parent 6dea9a6 commit 1d34f3a

6 files changed

Lines changed: 12 additions & 15 deletions

File tree

src/store/datasets-dicom.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ export const useDICOMStore = defineStore('dicom', {
167167
if (importedAsCine) return;
168168
}
169169

170-
if (this.volumeInfo[id]?.kind === 'cine') {
171-
throw new Error(
172-
`Volume ${id} is already loaded as a cine clip; cannot re-import as a chunk volume.`
173-
);
174-
}
175170
const cachedImage = imageCacheStore.imageById[id];
176171
if (cachedImage && !(cachedImage instanceof DicomChunkImage)) {
177172
throw new Error(

src/store/views.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ export const useViewStore = defineStore('view', () => {
267267

268268
view.dataID = dataID;
269269
ViewDataChangeEvent.trigger(viewID, dataID);
270-
// Global tools resolve their image through activeView.
270+
// If activeView is null/stale, fall back to a visible view so global
271+
// tools (which resolve their image through activeView) have one to read.
271272
ensureActiveViewIsVisible();
272273
}
273274

tests/specs/cine-ruler-session.e2e.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// silently lose the per-frame association.
55
import * as path from 'path';
66
import { CINE_US_DATASET } from './configTestUtils';
7-
import { openUrls, waitForFileExists } from './utils';
7+
import { openUrls, SESSION_SAVE_TIMEOUT, waitForFileExists } from './utils';
88
import { volViewPage } from '../pageobjects/volview.page';
99
import { TEMP_DIR } from '../../wdio.shared.conf';
1010
import {
@@ -16,8 +16,6 @@ import {
1616
waitForFrame,
1717
} from './cineTestUtils';
1818

19-
const SESSION_SAVE_TIMEOUT = 40000;
20-
2119
const placeRulerAtCanvasCenter = async () => {
2220
const rulerToolButton = await $('button span i[class~=mdi-ruler]');
2321
await rulerToolButton.click();

tests/specs/session-state-lifecycle.e2e.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import * as path from 'path';
22
import * as fs from 'fs';
33
import JSZip from 'jszip';
44
import { MINIMAL_501_SESSION, PROSTATEX_DATASET } from './configTestUtils';
5-
import { downloadFile, openUrls, waitForFileExists } from './utils';
5+
import {
6+
downloadFile,
7+
openUrls,
8+
SESSION_SAVE_TIMEOUT,
9+
waitForFileExists,
10+
} from './utils';
611
import { setValueVueInput, volViewPage } from '../pageobjects/volview.page';
712
import { TEMP_DIR } from '../../wdio.shared.conf';
813

9-
const SESSION_SAVE_TIMEOUT = 40000;
10-
1114
const waitForElementCount = async (selector: string, minCount = 1) => {
1215
await browser.waitUntil(async () => {
1316
const count = await browser.execute(

tests/specs/state-manifest.e2e.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { FIXTURES, WINDOW_SIZE } from '../../wdio.shared.conf';
33
import { volViewPage } from '../pageobjects/volview.page';
44
import { openVolViewPage, writeManifestToZip } from './utils';
55

6-
describe('State file manifest.json code', function () {
7-
this.timeout(120_000);
8-
6+
describe('State file manifest.json code', () => {
97
it('has no errors loading version 5.0.1 manifest.json file ', async () => {
108
const manifestPath = path.join(
119
FIXTURES,

tests/specs/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export async function openVolViewPage(fileName: string) {
7878

7979
type RemoteResourceType = z.infer<typeof RemoteResource> & { name: string };
8080

81+
export const SESSION_SAVE_TIMEOUT = 40_000;
82+
8183
export const waitForFileExists = (filePath: string, timeout: number) =>
8284
new Promise<void>((resolve, reject) => {
8385
const dir = path.dirname(filePath);

0 commit comments

Comments
 (0)