import React from 'react';
import { test, expect } from '@playwright/experimental-ct-react';

import { WithActions } from '@digigov/ui/content/SummaryList/__stories__/WithActions';

test('renders the WithActions Navigate with keyboard', async ({
  mount,
  page,
}) => {
  await mount(<WithActions />);
  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);

  await page.keyboard.press('Tab');
  await page.keyboard.press('Tab');

  const screenshot = await page.screenshot({
    fullPage: true,
    animations: 'disabled',
  });
  expect(screenshot).toMatchSnapshot();
});
