- Updated branding from "SolaceScanScout" to "Solace" across various files including deployment scripts, API responses, and documentation. - Changed default base URL for Playwright tests and updated security headers to reflect the new branding. - Enhanced README and API documentation to include new authentication endpoints and product access details. This refactor aligns the project branding and improves clarity in the API documentation.
32 lines
890 B
TypeScript
32 lines
890 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { resolveExplorerApiBase } from './api-base'
|
|
|
|
describe('resolveExplorerApiBase', () => {
|
|
it('prefers an explicit env value when present', () => {
|
|
expect(
|
|
resolveExplorerApiBase({
|
|
envValue: 'https://blockscout.defi-oracle.io/',
|
|
browserOrigin: 'http://127.0.0.1:3000',
|
|
})
|
|
).toBe('https://blockscout.defi-oracle.io')
|
|
})
|
|
|
|
it('falls back to same-origin in the browser when env is empty', () => {
|
|
expect(
|
|
resolveExplorerApiBase({
|
|
envValue: '',
|
|
browserOrigin: 'http://127.0.0.1:3000/',
|
|
})
|
|
).toBe('http://127.0.0.1:3000')
|
|
})
|
|
|
|
it('falls back to the local backend on the server when no other base is available', () => {
|
|
expect(
|
|
resolveExplorerApiBase({
|
|
envValue: '',
|
|
browserOrigin: '',
|
|
})
|
|
).toBe('http://localhost:8080')
|
|
})
|
|
})
|