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

feat(panel): Add tooling to test onscroll event for FlowItem and Panel #842 #859 #1050

Merged
merged 5 commits into from
Aug 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 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,24 @@ describe("calcite-panel", () => {

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

it("honors calcitePanelScroll event", async () => {
const page = await newE2EPage({
html: "<calcite-panel>test</calcite-panel>"
});

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

await page.evaluate((contentContainerSelector) => {
const contentContainer = document
.querySelector("calcite-panel")
.shadowRoot.querySelector(contentContainerSelector);

contentContainer.dispatchEvent(new CustomEvent("scroll"));
}, `.${CSS.contentContainer}`);

await page.waitForChanges();

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