Skip to content

Commit

Permalink
make sure the non existing tab is not displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
Agney committed Aug 14, 2021
1 parent 56352c1 commit c113305
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions playground/src/__tests__/Editor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("Editor", () => {

it("should render only the tabs that provided code", () => {
const defaultTab = "markup";
const { getByText, container, debug } = render(
const { getByText, queryByText } = render(
<Editor
width={40}
code={emptySnippet}
Expand All @@ -49,10 +49,13 @@ describe("Editor", () => {
/>
);

const html = getByText("HTML");
const javascript = getByText("JS");
const htmlTab = getByText("HTML");
const javascriptTab = getByText("JS");

expect(html).toBeTruthy();
expect(javascript).toBeTruthy();
expect(htmlTab).toBeTruthy();
expect(javascriptTab).toBeTruthy();

const cssTab = queryByText("CSS");
expect(cssTab).toBeFalsy();
});
});

0 comments on commit c113305

Please sign in to comment.