svg-layout-designer-react/src/Components/API/api.test.tsx
Eric Nguyen d9e06537e8
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Merged PR 16: Transform every single class components into functional component
This improve greatly the performance and the code cleaning.
It allows us to separate the inseparable class methods into modules functions
2022-08-09 15:15:56 +00:00

18 lines
703 B
TypeScript

import { describe, it, expect } from 'vitest';
import { fetchConfiguration } from './api';
describe.concurrent('API test', () => {
it('Load environment', () => {
const url = import.meta.env.VITE_API_URL;
expect(url).toBe('http://localhost:5000');
});
it('Fetch configuration', async() => {
const configuration = await fetchConfiguration();
expect(configuration.MainContainer).toBeDefined();
expect(configuration.MainContainer.Height).toBeGreaterThan(0);
expect(configuration.MainContainer.Width).toBeGreaterThan(0);
expect(configuration.AvailableContainers.length).toBeGreaterThan(-1);
expect(configuration.AvailableSymbols.length).toBeGreaterThan(-1);
});
});