Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(card): remove redundant spy and setup wrapper element #10429

Merged
merged 1 commit into from
Sep 28, 2024
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
6 changes: 1 addition & 5 deletions packages/calcite-components/src/components/card/card.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,22 @@ describe("calcite-card", () => {
describe("when a card is selectable (deprecated)", () => {
it("should update the card's selected state when its checkbox is clicked", async () => {
const page = await newE2EPage();
await page.setContent(`
<div style="width:260px">
await page.setContent(html`
<calcite-card label="example-label" selectable>
<h3 slot="title">ArcGIS Online: Gallery and Organization pages</h3>
<span slot="subtitle">
A great example of a study description that might wrap to a line or two, but isn't overly verbose.
</span>
</calcite-card>
</div>
`);
const card = await page.find("calcite-card");
const checkbox = await page.find(`calcite-card >>> .${CSS.checkboxWrapperDeprecated} calcite-checkbox`);
const cardSelectSpy = await card.spyOnEvent("calciteCardSelect");
const clickSpy = await card.spyOnEvent("calciteCardSelect");

await checkbox.click();
await page.waitForChanges();

expect(cardSelectSpy).toHaveReceivedEventTimes(1);
expect(clickSpy).toHaveReceivedEventTimes(1);
expect(await checkbox.getProperty("checked")).toBe(true);
expect(await card.getProperty("selected")).toBe(true);
});
Expand Down
Loading