diff --git a/e2e/chromeOpts.js b/e2e/chromeOpts.js index eccfe512b1c0bd422f441252f3b5dc70431ab590..8af7d2b44f19fe2945dca7fc63b8dcd7c5139c11 100644 --- a/e2e/chromeOpts.js +++ b/e2e/chromeOpts.js @@ -4,5 +4,6 @@ module.exports = [ '--disable-gpu', '--disable-setuid-sandbox', "--disable-extensions", - '--window-size=800,796' + '--window-size=800,796', + '--disable-application-cache' ] \ No newline at end of file diff --git a/e2e/src/advanced/nonAtlasImages.prod.e2e-spec.js b/e2e/src/advanced/nonAtlasImages.prod.e2e-spec.js index 7cc3ecca1f689cd840bc28548e916f208797c44f..9a6b9cf6360b05788dd58379c5a90ad35016335f 100644 --- a/e2e/src/advanced/nonAtlasImages.prod.e2e-spec.js +++ b/e2e/src/advanced/nonAtlasImages.prod.e2e-spec.js @@ -81,16 +81,27 @@ describe('> non-atlas images', () => { await iavPage.wait(10000) const interceptedCalls = await iavPage.getInterceptedHttpCalls() - expect( - interceptedCalls - ).toContain( - jasmine.objectContaining( - { - method: 'GET', - url: 'https://zam10143.zam.kfa-juelich.de/chumni/nifti/5c38faad1b0deab8d1674248b0107cd3637faa46a88e7a039c511163/BI-TIM/info' - } - ) - ) + const arr = [ + 'BI-FOM-HSV_R', + 'BI-FOM-HSV_G', + 'BI-FOM-HSV_B', + 'BI', + 'BI-TIM', + 'BI-MRI', + 'BI-MRS', + ] + + for (const item of arr) { + expect( + interceptedCalls.find(({ + method, + url + }) => { + const regex = new RegExp(item) + return method === 'GET' && regex.test(url) + }) + ).toBeTruthy() + } expect( interceptedCalls diff --git a/src/util/constants.ts b/src/util/constants.ts index 021c8087b6f2c383b6a8130f6b56863b31128da2..bfb83d130f37e87b74f201971016e38012127395 100644 --- a/src/util/constants.ts +++ b/src/util/constants.ts @@ -14,13 +14,14 @@ export const LOCAL_STORAGE_CONST = { export const COOKIE_VERSION = '0.3.0' export const KG_TOS_VERSION = '0.3.0' export const DS_PREVIEW_URL = DATASET_PREVIEW_URL -export const BACKENDURL = BACKEND_URL && /^http/.test(BACKEND_URL) - ? BACKEND_URL - : (() => { - const url = new URL(window.location.href) - const { protocol, hostname, pathname } = url - return `${protocol}//${hostname}${pathname.replace(/\/$/, '')}/${BACKEND_URL}` - })() || 'http://localhost:3000/' +export const BACKENDURL = (() => { + if (!BACKEND_URL) return `http://localhost:3000/` + if (/^http/.test(BACKEND_URL)) return BACKEND_URL + + const url = new URL(window.location.href) + const { protocol, hostname, pathname } = url + return `${protocol}//${hostname}${pathname.replace(/\/$/, '')}/${BACKEND_URL}` +})() export const MIN_REQ_EXPLAINER = ` - Interactive atlas viewer requires **webgl2.0**, and the \`EXT_color_buffer_float\` extension enabled.