Brak opisu

computeStyles.test.js 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * @jest-environment puppeteer
  3. * @flow
  4. */
  5. import { scroll, screenshot } from '../utils/puppeteer.js';
  6. // FIXME: enable them again once we migrate to Playwright
  7. it.skip('should grow to the left', async () => {
  8. const page = await browser.newPage();
  9. await page.goto(`${TEST_URL}/modifiers/computeStyles/main.html`);
  10. await scroll(page, '.scroll1', 100);
  11. await page.evaluate(() => {
  12. const popper = document.querySelector('#popper');
  13. if (popper) popper.innerText = 'This is longer than the previous text';
  14. });
  15. expect(await screenshot(page)).toMatchImageSnapshot();
  16. });
  17. // FIXME: enable them again once we migrate to Playwright
  18. it.skip('should grow to the top', async () => {
  19. const page = await browser.newPage();
  20. await page.goto(`${TEST_URL}/modifiers/computeStyles/main.html`);
  21. await page.evaluate(() => {
  22. const popper = document.querySelector('#popper');
  23. if (popper) popper.innerText = 'This is longer than the previous text';
  24. });
  25. expect(await screenshot(page)).toMatchImageSnapshot();
  26. });
  27. it('should position the popper on the left', async () => {
  28. const page = await browser.newPage();
  29. await page.goto(`${TEST_URL}/modifiers/computeStyles/adaptive-left.html`);
  30. expect(await screenshot(page)).toMatchImageSnapshot();
  31. });
  32. it('should position the popper on the top', async () => {
  33. const page = await browser.newPage();
  34. await page.goto(`${TEST_URL}/modifiers/computeStyles/adaptive-top.html`);
  35. expect(await screenshot(page)).toMatchImageSnapshot();
  36. });
  37. it('should position the popper on the left (gpu)', async () => {
  38. const page = await browser.newPage();
  39. await page.goto(`${TEST_URL}/modifiers/computeStyles/adaptive-left-gpu.html`);
  40. expect(await screenshot(page)).toMatchImageSnapshot();
  41. });
  42. it('should position the popper on the top (gpu)', async () => {
  43. const page = await browser.newPage();
  44. await page.goto(`${TEST_URL}/modifiers/computeStyles/adaptive-top-gpu.html`);
  45. expect(await screenshot(page)).toMatchImageSnapshot();
  46. });