Bez popisu

hide.test.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @jest-environment puppeteer
  3. * @flow
  4. */
  5. import { scroll, screenshot } from '../utils/puppeteer.js';
  6. it('should be yellow color when the reference is hidden', async () => {
  7. const page = await browser.newPage();
  8. await page.goto(`${TEST_URL}/modifiers/hide/index.html`);
  9. await scroll(page, '.scroll2', 250);
  10. await scroll(page, '.scroll3', 500);
  11. expect(await screenshot(page)).toMatchImageSnapshot();
  12. });
  13. it('should be white color when the popper has escaped the reference container', async () => {
  14. const page = await browser.newPage();
  15. await page.goto(`${TEST_URL}/modifiers/hide/index.html`);
  16. await scroll(page, '.scroll2', 250);
  17. await scroll(page, '.scroll3', 500);
  18. await scroll(page, '.scroll1', 10);
  19. expect(await screenshot(page)).toMatchImageSnapshot();
  20. });
  21. it('should be normal purple color when the reference is visible and popper is not escaped', async () => {
  22. const page = await browser.newPage();
  23. await page.goto(`${TEST_URL}/modifiers/hide/index.html`);
  24. await scroll(page, '.scroll2', 250);
  25. await scroll(page, '.scroll3', 500);
  26. await scroll(page, '.scroll1', 100);
  27. expect(await screenshot(page)).toMatchImageSnapshot();
  28. });