import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { AskingForNumbers } from '@digigov/ui/form/TextInput/__stories__/AskingForNumbers';
import { Default } from '@digigov/ui/form/TextInput/__stories__/Default';
import { Dense } from '@digigov/ui/form/TextInput/__stories__/Dense';
import { DisabledInput } from '@digigov/ui/form/TextInput/__stories__/DisabledInput';
import { DisabledInputWithValue } from '@digigov/ui/form/TextInput/__stories__/DisabledInputWithValue';
import { FixedWidths } from '@digigov/ui/form/TextInput/__stories__/FixedWidths';
import { FluidWidths } from '@digigov/ui/form/TextInput/__stories__/FluidWidths';
import { MultipleQuestions } from '@digigov/ui/form/TextInput/__stories__/MultipleQuestions';
import { WithErrorMessage } from '@digigov/ui/form/TextInput/__stories__/WithErrorMessage';
import { WithHint } from '@digigov/ui/form/TextInput/__stories__/WithHint';

test('renders the All TextInput variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="AskingForNumbers">
      <AskingForNumbers />
    </TestVariant>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="Dense">
      <Dense />
    </TestVariant>
    <TestVariant title="DisabledInput">
      <DisabledInput />
    </TestVariant>
    <TestVariant title="DisabledInputWithValue">
      <DisabledInputWithValue />
    </TestVariant>
    <TestVariant title="FixedWidths">
      <FixedWidths />
    </TestVariant>
    <TestVariant title="FluidWidths">
      <FluidWidths />
    </TestVariant>
    <TestVariant title="MultipleQuestions">
      <MultipleQuestions />
    </TestVariant>
    <TestVariant title="WithErrorMessage">
      <WithErrorMessage />
    </TestVariant>
    <TestVariant title="WithHint">
      <WithHint />
    </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();
});
  
