Skip to content

Commit

Permalink
test(card): remove redundant spy and setup wrapper element (#10429)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfranco authored Sep 28, 2024
1 parent 9312e29 commit 3bc2e15
Showing 1 changed file with 1 addition and 5 deletions.
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

0 comments on commit 3bc2e15

Please sign in to comment.