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);
  });
});
