13b54f07de
Build & Deploy / Build & Push Docker Image (push) Successful in 2m54s
Test / Type Check (all packages) (push) Successful in 52s
Build & Deploy / Deploy to VPS (push) Successful in 3s
Test / API Unit Tests (push) Failing after 1m9s
Test / Homepage Unit Tests (push) Successful in 45s
Test / Storefront Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 43s
Test / Dashboard Unit Tests (push) Successful in 43s
Test / API Integration Tests (push) Successful in 1m0s
18 lines
725 B
TypeScript
18 lines
725 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { normalizeApiBase } from '@/lib/api';
|
|
|
|
describe('homepage API base URL', () => {
|
|
it('keeps API URLs that already include the version prefix', () => {
|
|
expect(normalizeApiBase('https://api.rentaldrivego.ma/api/v1')).toBe('https://api.rentaldrivego.ma/api/v1');
|
|
});
|
|
|
|
it('adds the version prefix when production env only contains the API host', () => {
|
|
expect(normalizeApiBase('https://api.rentaldrivego.ma')).toBe('https://api.rentaldrivego.ma/api/v1');
|
|
});
|
|
|
|
it('normalizes trailing slashes before appending the version prefix', () => {
|
|
expect(normalizeApiBase('https://api.rentaldrivego.ma/')).toBe('https://api.rentaldrivego.ma/api/v1');
|
|
});
|
|
});
|