import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { Default } from '@digigov/ui/content/Card/__stories__/Default';
import { Dense } from '@digigov/ui/content/Card/__stories__/Dense';
import { WithClickableContent } from '@digigov/ui/content/Card/__stories__/WithClickableContent';
import { WithClickableLink } from '@digigov/ui/content/Card/__stories__/WithClickableLink';
import { WithDarkBorder } from '@digigov/ui/content/Card/__stories__/WithDarkBorder';
import { WithDarkTopBorder } from '@digigov/ui/content/Card/__stories__/WithDarkTopBorder';
import { WithDivider } from '@digigov/ui/content/Card/__stories__/WithDivider';
import { WithGrayBorder } from '@digigov/ui/content/Card/__stories__/WithGrayBorder';
import { WithGrayTopBorder } from '@digigov/ui/content/Card/__stories__/WithGrayTopBorder';
import { WithGroupButton } from '@digigov/ui/content/Card/__stories__/WithGroupButton';
import { WithLink } from '@digigov/ui/content/Card/__stories__/WithLink';

test('renders the All Card variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="Dense">
      <Dense />
    </TestVariant>
    <TestVariant title="WithClickableContent">
      <WithClickableContent />
    </TestVariant>
    <TestVariant title="WithClickableLink">
      <WithClickableLink />
    </TestVariant>
    <TestVariant title="WithDarkBorder">
      <WithDarkBorder />
    </TestVariant>
    <TestVariant title="WithDarkTopBorder">
      <WithDarkTopBorder />
    </TestVariant>
    <TestVariant title="WithDivider">
      <WithDivider />
    </TestVariant>
    <TestVariant title="WithGrayBorder">
      <WithGrayBorder />
    </TestVariant>
    <TestVariant title="WithGrayTopBorder">
      <WithGrayTopBorder />
    </TestVariant>
    <TestVariant title="WithGroupButton">
      <WithGroupButton />
    </TestVariant>
    <TestVariant title="WithLink">
      <WithLink />
    </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();
});
  
