import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { AccessibilityLoader } from '@digigov/ui/app/Loader/__stories__/AccessibilityLoader';
import { Default } from '@digigov/ui/app/Loader/__stories__/Default';
import { FullPageLoader } from '@digigov/ui/app/Loader/__stories__/FullPageLoader';
import { Secondary } from '@digigov/ui/app/Loader/__stories__/Secondary';
import { Sizes } from '@digigov/ui/app/Loader/__stories__/Sizes';

test('renders the All Loader variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="AccessibilityLoader">
      <AccessibilityLoader />
    </TestVariant>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="FullPageLoader">
      <FullPageLoader />
    </TestVariant>
    <TestVariant title="Secondary">
      <Secondary />
    </TestVariant>
    <TestVariant title="Sizes">
      <Sizes />
    </TestVariant>
  </div>
  )
  await page.evaluate(() => document.fonts.ready);

  // Move the mouse to the top-left corner to avoid random hover issues
  await page.mouse.move(0, 0);


  const screenshot = await page.screenshot({ fullPage: true, animations: 'disabled' });
  expect(screenshot).toMatchSnapshot();
});
  
