Нет описания

resize.test.js 433B

1234567891011121314151617
  1. /**
  2. * @jest-environment puppeteer
  3. * @flow
  4. */
  5. import { screenshot } from '../utils/puppeteer.js';
  6. it('should update the position when window is resized', async () => {
  7. const page = await browser.newPage();
  8. await page.goto(`${TEST_URL}/resize.html`);
  9. expect(await screenshot(page)).toMatchImageSnapshot();
  10. await page.setViewport({ width: 400, height: 400 });
  11. expect(await screenshot(page)).toMatchImageSnapshot();
  12. });