This commit is contained in:
Andras Schmelczer 2026-05-28 21:24:47 +01:00
parent 3ad2766f82
commit f74ee43cb4
196 changed files with 18949 additions and 32173 deletions

View file

@ -0,0 +1,28 @@
import { describe, it, expect, vi } from 'vitest';
// Mock environment
vi.mock('../../environments/environment', () => ({
environment: { apiBase: 'http://test-api', production: false },
}));
describe('ApiService URL patterns', () => {
const baseUrl = 'http://test-api';
it('constructs correct health URL', () => {
expect(`${baseUrl}/api/v1/health`).toBe('http://test-api/api/v1/health');
});
it('constructs correct register URL', () => {
expect(`${baseUrl}/api/v1/register`).toBe('http://test-api/api/v1/register');
});
it('constructs correct data URL', () => {
expect(`${baseUrl}/api/v1/data`).toBe('http://test-api/api/v1/data');
});
it('formats Authorization header correctly', () => {
const token = 'abc-def-123';
const header = `Bearer ${token}`;
expect(header).toBe('Bearer abc-def-123');
});
});