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

import { Default } from '@digigov/ui/content/StepNav/__stories__/Default';

test('renders the Default Click 1st and all', async ({ mount, page }) => {
  await mount(<Default />);
  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
    .locator(
      '#root>div>ol>li:nth-child(1)>details>summary>h2>div>span:nth-child(1)'
    )
    .hover();
  await page
    .locator(
      '#root>div>ol>li:nth-child(1)>details>summary>h2>div>span:nth-child(1)'
    )
    .click();
  await page.locator('#root>div>div>button').click();

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