import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { AlignRight } from '@digigov/ui/navigation/Dropdown/__stories__/AlignRight';
import { ContentPosition } from '@digigov/ui/navigation/Dropdown/__stories__/ContentPosition';
import { Default } from '@digigov/ui/navigation/Dropdown/__stories__/Default';
import { Dense } from '@digigov/ui/navigation/Dropdown/__stories__/Dense';
import { Disabled } from '@digigov/ui/navigation/Dropdown/__stories__/Disabled';
import { PlacementTop } from '@digigov/ui/navigation/Dropdown/__stories__/PlacementTop';
import { ScrollableContent } from '@digigov/ui/navigation/Dropdown/__stories__/ScrollableContent';
import { Secondary } from '@digigov/ui/navigation/Dropdown/__stories__/Secondary';
import { VariantLink } from '@digigov/ui/navigation/Dropdown/__stories__/VariantLink';
import { Warning } from '@digigov/ui/navigation/Dropdown/__stories__/Warning';
import { WithIcons } from '@digigov/ui/navigation/Dropdown/__stories__/WithIcons';

test('renders the All Dropdown variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="AlignRight">
      <AlignRight />
    </TestVariant>
    <TestVariant title="ContentPosition">
      <ContentPosition />
    </TestVariant>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="Dense">
      <Dense />
    </TestVariant>
    <TestVariant title="Disabled">
      <Disabled />
    </TestVariant>
    <TestVariant title="PlacementTop">
      <PlacementTop />
    </TestVariant>
    <TestVariant title="ScrollableContent">
      <ScrollableContent />
    </TestVariant>
    <TestVariant title="Secondary">
      <Secondary />
    </TestVariant>
    <TestVariant title="VariantLink">
      <VariantLink />
    </TestVariant>
    <TestVariant title="Warning">
      <Warning />
    </TestVariant>
    <TestVariant title="WithIcons">
      <WithIcons />
    </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();
});
  
