mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
test(accordion): flip active class assertion
This commit is contained in:
parent
ad74124206
commit
90f22404b8
1 changed files with 18 additions and 4 deletions
|
@ -104,11 +104,25 @@ describe("Accordion", () => {
|
||||||
expect(items).toHaveLength(4);
|
expect(items).toHaveLength(4);
|
||||||
|
|
||||||
// First item is open.
|
// First item is open.
|
||||||
expect(items[0]).toHaveAttribute("class", expect.stringContaining("bx--accordion__item bx--accordion__item--active"));
|
expect(items[0]).toHaveAttribute(
|
||||||
|
"class",
|
||||||
|
expect.stringContaining(
|
||||||
|
"bx--accordion__item bx--accordion__item--active",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
// All other items are collapsed.
|
// All other items are collapsed.
|
||||||
expect(items[1]).toHaveAttribute("class", expect.stringContaining("bx--accordion__item"));
|
expect(items[1]).toHaveAttribute(
|
||||||
expect(items[2]).toHaveAttribute("class", expect.stringContaining("bx--accordion__item"));
|
"class",
|
||||||
expect(items[3]).toHaveAttribute("class", expect.stringContaining("bx--accordion__item"));
|
expect.not.stringContaining("bx--accordion__item--active"),
|
||||||
|
);
|
||||||
|
expect(items[2]).toHaveAttribute(
|
||||||
|
"class",
|
||||||
|
expect.not.stringContaining("bx--accordion__item--active"),
|
||||||
|
);
|
||||||
|
expect(items[3]).toHaveAttribute(
|
||||||
|
"class",
|
||||||
|
expect.not.stringContaining("bx--accordion__item--active"),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue