import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';
import TestVariant from '@digigov/ui/utils/TestVariant'
import { DarkBackground } from '@digigov/ui/navigation/Link/__stories__/DarkBackground';
import { DarkBackgroundNoUnderline } from '@digigov/ui/navigation/Link/__stories__/DarkBackgroundNoUnderline';
import { Default } from '@digigov/ui/navigation/Link/__stories__/Default';
import { ExternalLink } from '@digigov/ui/navigation/Link/__stories__/ExternalLink';
import { NoUnderline } from '@digigov/ui/navigation/Link/__stories__/NoUnderline';
import { OpensInNewTab } from '@digigov/ui/navigation/Link/__stories__/OpensInNewTab';
import { WithProvider } from '@digigov/ui/navigation/Link/__stories__/WithProvider';

test('renders the All Link variants', async ({ mount, page }) => {
  await mount(
    
  <div>
    <TestVariant title="DarkBackground">
      <DarkBackground />
    </TestVariant>
    <TestVariant title="DarkBackgroundNoUnderline">
      <DarkBackgroundNoUnderline />
    </TestVariant>
    <TestVariant title="Default">
      <Default />
    </TestVariant>
    <TestVariant title="ExternalLink">
      <ExternalLink />
    </TestVariant>
    <TestVariant title="NoUnderline">
      <NoUnderline />
    </TestVariant>
    <TestVariant title="OpensInNewTab">
      <OpensInNewTab />
    </TestVariant>
    <TestVariant title="WithProvider">
      <WithProvider />
    </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();
});
  
