Skip to content

Commit 7e1186e

Browse files
committed
use class prefix constant to create class names in Button tests
1 parent 40885d3 commit 7e1186e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/Button/Button.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe("Button", () => {
2222
</Button>
2323
);
2424
expect(screen.getByRole("button").lastChild).toEqual(screen.getByText(/left icon/i));
25-
expect(container.getElementsByClassName("eccgui-icon").length).toBe(1);
25+
expect(container.getElementsByClassName(`${eccgui}-icon`).length).toBe(1);
2626
});
2727

2828
it("should have icon at the right after the text", () => {
@@ -32,7 +32,7 @@ describe("Button", () => {
3232
</Button>
3333
);
3434
expect(screen.getByRole("button").firstChild).toEqual(screen.getByText(/right icon/i));
35-
expect(container.getElementsByClassName("eccgui-icon").length).toBe(1);
35+
expect(container.getElementsByClassName(`${eccgui}-icon`).length).toBe(1);
3636
});
3737

3838
it("should render badge markup with correct content when used on an icon button", () => {

0 commit comments

Comments
 (0)