import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { Default } from '@digigov/ui/form/DateInputContainer/__stories__/Default';
import { Dense } from '@digigov/ui/form/DateInputContainer/__stories__/Dense';
import { MultipleQuestions } from '@digigov/ui/form/DateInputContainer/__stories__/MultipleQuestions';
import { WithErrorMessage } from '@digigov/ui/form/DateInputContainer/__stories__/WithErrorMessage';
import { WithErrorMessageForSingleField } from '@digigov/ui/form/DateInputContainer/__stories__/WithErrorMessageForSingleField';

test('renders the All DateInputContainer variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="Dense">
      <Dense />
    </TestVariant>
    <TestVariant title="MultipleQuestions">
      <MultipleQuestions />
    </TestVariant>
    <TestVariant title="WithErrorMessage">
      <WithErrorMessage />
    </TestVariant>
    <TestVariant title="WithErrorMessageForSingleField">
      <WithErrorMessageForSingleField />
    </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();
});
  
