Skip to content

Commit

Permalink
test(accordion): flip active class assertino
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Dec 29, 2024
1 parent 5062dc9 commit 31798e2
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions tests/Accordion/Accordion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,25 @@ describe("Accordion", () => {
expect(items).toHaveLength(4);

// 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.
expect(items[1]).toHaveAttribute("class", expect.stringContaining("bx--accordion__item"));
expect(items[2]).toHaveAttribute("class", expect.stringContaining("bx--accordion__item"));
expect(items[3]).toHaveAttribute("class", expect.stringContaining("bx--accordion__item"));
expect(items[1]).toHaveAttribute(
"class",
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"),
);
});
});

0 comments on commit 31798e2

Please sign in to comment.