import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { Back } from '@digigov/ui/form/Button/__stories__/Back';
import { ButtonLinkButton } from '@digigov/ui/form/Button/__stories__/ButtonLinkButton';
import { CallToActionButton } from '@digigov/ui/form/Button/__stories__/CallToActionButton';
import { Dense } from '@digigov/ui/form/Button/__stories__/Dense';
import { Disabled } from '@digigov/ui/form/Button/__stories__/Disabled';
import { GroupingButtons } from '@digigov/ui/form/Button/__stories__/GroupingButtons';
import { GroupingButtonsAndLinks } from '@digigov/ui/form/Button/__stories__/GroupingButtonsAndLinks';
import { Primary } from '@digigov/ui/form/Button/__stories__/Primary';
import { Secondary } from '@digigov/ui/form/Button/__stories__/Secondary';
import { ThemeToggle } from '@digigov/ui/form/Button/__stories__/ThemeToggle';
import { Warning } from '@digigov/ui/form/Button/__stories__/Warning';
import { WithVariantLink } from '@digigov/ui/form/Button/__stories__/WithVariantLink';

test('renders the All Button variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="Back">
      <Back />
    </TestVariant>
    <TestVariant title="ButtonLinkButton">
      <ButtonLinkButton />
    </TestVariant>
    <TestVariant title="CallToActionButton">
      <CallToActionButton />
    </TestVariant>
    <TestVariant title="Dense">
      <Dense />
    </TestVariant>
    <TestVariant title="Disabled">
      <Disabled />
    </TestVariant>
    <TestVariant title="GroupingButtons">
      <GroupingButtons />
    </TestVariant>
    <TestVariant title="GroupingButtonsAndLinks">
      <GroupingButtonsAndLinks />
    </TestVariant>
    <TestVariant title="Primary">
      <Primary />
    </TestVariant>
    <TestVariant title="Secondary">
      <Secondary />
    </TestVariant>
    <TestVariant title="ThemeToggle">
      <ThemeToggle />
    </TestVariant>
    <TestVariant title="Warning">
      <Warning />
    </TestVariant>
    <TestVariant title="WithVariantLink">
      <WithVariantLink />
    </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();
});
  
