feat: introduce backend url environment variable

ref: N25B-352
This commit is contained in:
Twirre Meulenbelt
2026-01-29 17:40:49 +01:00
parent 378a64c7ca
commit 4395e44dbf
15 changed files with 65 additions and 23 deletions

View File

@@ -3,6 +3,7 @@
// © Copyright Utrecht University (Department of Information and Computing Sciences)
import { render, screen, act, cleanup, fireEvent } from '@testing-library/react';
import Robot from '../../../src/pages/Robot/Robot';
import { API_BASE_URL } from '../../../src/config/api.ts';
// Mock EventSource
const mockInstances: MockEventSource[] = [];
@@ -64,7 +65,7 @@ describe('Robot', () => {
await act(async () => fireEvent.click(button));
expect(globalThis.fetch).toHaveBeenCalledWith(
'http://localhost:8000/message',
`${API_BASE_URL}/message`,
expect.objectContaining({
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -83,7 +84,7 @@ describe('Robot', () => {
);
expect(globalThis.fetch).toHaveBeenCalledWith(
'http://localhost:8000/message',
`${API_BASE_URL}/message`,
expect.objectContaining({
method: 'POST',
headers: { 'Content-Type': 'application/json' },