diff --git a/frontend/src/api/__tests__/common.spec.ts b/frontend/src/api/__tests__/common.spec.ts index 3f648c58..a39cb488 100644 --- a/frontend/src/api/__tests__/common.spec.ts +++ b/frontend/src/api/__tests__/common.spec.ts @@ -1,23 +1,29 @@ import { describe, it, expect } from 'vitest' -import { API_BASE_PREFIX, API_BASE_PREFIX_ANNONARS, API_BASE_PREFIX_MEHARI } from '../common' +import { API_BASE_PREFIX, API_BASE_PREFIX_ANNONARS, API_BASE_PREFIX_MEHARI, API_BASE_PREFIX_NGINX } from '../common' describe.concurrent('API_BASE_PREFIX constants', () => { it('returns the correct API base prefix in production mode', () => { const originalMode = import.meta.env.MODE - expect(API_BASE_PREFIX).toBe('/') + expect(API_BASE_PREFIX).toBe('/internal/') import.meta.env.MODE = originalMode }) it('returns the correct API base prefix for annonars in production mode', () => { const originalMode = import.meta.env.MODE - expect(API_BASE_PREFIX_ANNONARS).toBe('/proxy/annonars') + expect(API_BASE_PREFIX_ANNONARS).toBe('/internal/proxy/annonars') import.meta.env.MODE = originalMode }) it('returns the correct API base prefix for mehari in production mode', () => { const originalMode = import.meta.env.MODE - expect(API_BASE_PREFIX_MEHARI).toBe('/proxy/mehari') + expect(API_BASE_PREFIX_MEHARI).toBe('/internal/proxy/mehari') + import.meta.env.MODE = originalMode + }) + + it('returns the correct API base prefix for nginx in production mode', () => { + const originalMode = import.meta.env.MODE + expect(API_BASE_PREFIX_NGINX).toBe('/internal/proxy/nginx') import.meta.env.MODE = originalMode }) })