import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { Button } from '@digigov/ui/app/Skeleton/__stories__/Button';
import { Circular } from '@digigov/ui/app/Skeleton/__stories__/Circular';
import { Default } from '@digigov/ui/app/Skeleton/__stories__/Default';
import { NoAnimation } from '@digigov/ui/app/Skeleton/__stories__/NoAnimation';
import { Rectangular } from '@digigov/ui/app/Skeleton/__stories__/Rectangular';
import { SpecificWidthAndHeight } from '@digigov/ui/app/Skeleton/__stories__/SpecificWidthAndHeight';
import { TextSizes } from '@digigov/ui/app/Skeleton/__stories__/TextSizes';
import { UnderTypography } from '@digigov/ui/app/Skeleton/__stories__/UnderTypography';
import { WithChildren } from '@digigov/ui/app/Skeleton/__stories__/WithChildren';

test('renders the All Skeleton variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="Button">
      <Button />
    </TestVariant>
    <TestVariant title="Circular">
      <Circular />
    </TestVariant>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="NoAnimation">
      <NoAnimation />
    </TestVariant>
    <TestVariant title="Rectangular">
      <Rectangular />
    </TestVariant>
    <TestVariant title="SpecificWidthAndHeight">
      <SpecificWidthAndHeight />
    </TestVariant>
    <TestVariant title="TextSizes">
      <TextSizes />
    </TestVariant>
    <TestVariant title="UnderTypography">
      <UnderTypography />
    </TestVariant>
    <TestVariant title="WithChildren">
      <WithChildren />
    </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();
});
  
