Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Enhancement: Add tooling to test onscroll event for FlowItem and Panel #842 #859

Closed
driskull opened this issue Feb 27, 2020 · 2 comments
Closed
Assignees
Labels
3 - installed enhancement New feature request for an existing component

Comments

@driskull
Copy link
Member

driskull commented Feb 27, 2020

Description

Enhancement: Add tooling to test onscroll event for FlowItem and Panel #842

#842 (review)

CC ISSUE :Esri/calcite-design-system#973

@driskull driskull added enhancement New feature request for an existing component 0 - new labels Feb 27, 2020
@driskull driskull added this to the Ice King milestone Feb 27, 2020
@driskull driskull self-assigned this Feb 27, 2020
@kat10140 kat10140 modified the milestones: Ice King, James Baxter Mar 10, 2020
@driskull
Copy link
Member Author

Hey @jcfranco do you know how to test scroll events with Jest/Puppeteer? I couldn't get it to work.

Tried:

it("honors calcitePanelScroll event", async () => {
    const page = await newE2EPage();

    await page.setContent(`<calcite-panel style="height:200px">
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p>
    <p>test</p></calcite-panel>`);

    const eventSpy = await page.spyOnEvent("calcitePanelScroll", "window");

    await page.evaluate(async () => {
      const calcitePanel = document.querySelector("calcite-panel");
      await calcitePanel.setFocus();
      const activeElement = calcitePanel.shadowRoot.activeElement;
      activeElement.scrollBy(0, 100);
      calcitePanel.scrollBy(0, 100);
      await new Promise((resolve) => {
        setTimeout(resolve, 100);
      });
    });

    expect(eventSpy).toHaveReceivedEvent();
  });

@jcfranco
Copy link
Member

jcfranco commented Oct 7, 2020

Moved to Esri/calcite-design-system#973

@jcfranco jcfranco closed this as completed Oct 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 - installed enhancement New feature request for an existing component
Projects
None yet
Development

No branches or pull requests

3 participants