Skip to content

Commit

Permalink
Factorize elements into beforeEach block
Browse files Browse the repository at this point in the history
  • Loading branch information
jibees committed Sep 22, 2023
1 parent 458a031 commit b9cd8ee
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,18 @@ describe("VerticalEllipsisMenuController test", () => {
</div>
</div>
`;
});

it("add show class to content when toggle is called", () => {
const button = document.getElementById("button");
const content = document.getElementById("content");
});

it("add show class to content when toggle is called", () => {
expect(content.classList.contains("show")).toBe(false);
button.click();
expect(content.classList.contains("show")).toBe(true);
});


it("remove show class from content when clicking button", () => {
const button = document.getElementById("button");
const content = document.getElementById("content");

button.click();
expect(content.classList.contains("show")).toBe(true);
button.click();
Expand All @@ -44,9 +40,6 @@ describe("VerticalEllipsisMenuController test", () => {


it("remove show class from content when clicking outside", () => {
const button = document.getElementById("button");
const content = document.getElementById("content");

button.click();
expect(content.classList.contains("show")).toBe(true);
document.body.click();
Expand Down

0 comments on commit b9cd8ee

Please sign in to comment.