Skip to content
Snippets Groups Projects
Commit 2c137c75 authored by Xiao Gui's avatar Xiao Gui
Browse files

fix: e2e tests

fix: minor fix of backend_url logic
parent d7e9ab5c
No related branches found
No related tags found
No related merge requests found
...@@ -4,5 +4,6 @@ module.exports = [ ...@@ -4,5 +4,6 @@ module.exports = [
'--disable-gpu', '--disable-gpu',
'--disable-setuid-sandbox', '--disable-setuid-sandbox',
"--disable-extensions", "--disable-extensions",
'--window-size=800,796' '--window-size=800,796',
'--disable-application-cache'
] ]
\ No newline at end of file
...@@ -81,16 +81,27 @@ describe('> non-atlas images', () => { ...@@ -81,16 +81,27 @@ describe('> non-atlas images', () => {
await iavPage.wait(10000) await iavPage.wait(10000)
const interceptedCalls = await iavPage.getInterceptedHttpCalls() const interceptedCalls = await iavPage.getInterceptedHttpCalls()
expect( const arr = [
interceptedCalls 'BI-FOM-HSV_R',
).toContain( 'BI-FOM-HSV_G',
jasmine.objectContaining( 'BI-FOM-HSV_B',
{ 'BI',
method: 'GET', 'BI-TIM',
url: 'https://zam10143.zam.kfa-juelich.de/chumni/nifti/5c38faad1b0deab8d1674248b0107cd3637faa46a88e7a039c511163/BI-TIM/info' '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( expect(
interceptedCalls interceptedCalls
......
...@@ -14,13 +14,14 @@ export const LOCAL_STORAGE_CONST = { ...@@ -14,13 +14,14 @@ export const LOCAL_STORAGE_CONST = {
export const COOKIE_VERSION = '0.3.0' export const COOKIE_VERSION = '0.3.0'
export const KG_TOS_VERSION = '0.3.0' export const KG_TOS_VERSION = '0.3.0'
export const DS_PREVIEW_URL = DATASET_PREVIEW_URL export const DS_PREVIEW_URL = DATASET_PREVIEW_URL
export const BACKENDURL = BACKEND_URL && /^http/.test(BACKEND_URL) export const BACKENDURL = (() => {
? BACKEND_URL 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 const url = new URL(window.location.href)
return `${protocol}//${hostname}${pathname.replace(/\/$/, '')}/${BACKEND_URL}` const { protocol, hostname, pathname } = url
})() || 'http://localhost:3000/' return `${protocol}//${hostname}${pathname.replace(/\/$/, '')}/${BACKEND_URL}`
})()
export const MIN_REQ_EXPLAINER = ` export const MIN_REQ_EXPLAINER = `
- Interactive atlas viewer requires **webgl2.0**, and the \`EXT_color_buffer_float\` extension enabled. - Interactive atlas viewer requires **webgl2.0**, and the \`EXT_color_buffer_float\` extension enabled.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment