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

Commit

Permalink
#859 add test for scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Aug 4, 2020
1 parent 740c516 commit 8dac78e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/components/calcite-panel/calcite-panel.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,27 @@ describe("calcite-panel", () => {

expect(tagName).toBe("ARTICLE");
});

it("honors calcitePanelScroll event", async () => {
const html = `
<calcite-panel style="height:200px; width:200px;">
<p style="height:1000px; width:200px;">Test content</p>
<p id="scrollToMe">Scroll to me</p>
</calcite-panel>
`;

const page = await newE2EPage({
html
});

const scrollSpy = await page.spyOnEvent("calcitePanelScroll");

await page.evaluate(() => {
document.querySelector("calcite-panel #scrollToMe").scrollIntoView();
});

await page.waitForChanges();

expect(scrollSpy).toHaveReceivedEventTimes(1);
});
});

0 comments on commit 8dac78e

Please sign in to comment.