import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { DateInputError } from '@digigov/ui/form/ErrorMessage/__stories__/DateInputError';
import { Default } from '@digigov/ui/form/ErrorMessage/__stories__/Default';
import { ErrorMessageOnly } from '@digigov/ui/form/ErrorMessage/__stories__/ErrorMessageOnly';

test('renders the All ErrorMessage variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="DateInputError">
      <DateInputError />
    </TestVariant>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="ErrorMessageOnly">
      <ErrorMessageOnly />
    </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();
});
  
