import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { Default } from '@digigov/ui/feedback/ErrorSummary/__stories__/Default';
import { Dense } from '@digigov/ui/feedback/ErrorSummary/__stories__/Dense';
import { ErrorGroupLinkedToInput } from '@digigov/ui/feedback/ErrorSummary/__stories__/ErrorGroupLinkedToInput';
import { LinkedToCheckbox } from '@digigov/ui/feedback/ErrorSummary/__stories__/LinkedToCheckbox';
import { LinkedToField } from '@digigov/ui/feedback/ErrorSummary/__stories__/LinkedToField';
import { LinkedToInput } from '@digigov/ui/feedback/ErrorSummary/__stories__/LinkedToInput';
import { WithBackLinkAndButton } from '@digigov/ui/feedback/ErrorSummary/__stories__/WithBackLinkAndButton';

test('renders the All ErrorSummary variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="Dense">
      <Dense />
    </TestVariant>
    <TestVariant title="ErrorGroupLinkedToInput">
      <ErrorGroupLinkedToInput />
    </TestVariant>
    <TestVariant title="LinkedToCheckbox">
      <LinkedToCheckbox />
    </TestVariant>
    <TestVariant title="LinkedToField">
      <LinkedToField />
    </TestVariant>
    <TestVariant title="LinkedToInput">
      <LinkedToInput />
    </TestVariant>
    <TestVariant title="WithBackLinkAndButton">
      <WithBackLinkAndButton />
    </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();
});
  
