From c1133059dd382839aa4a8ac63903452e49591a0a Mon Sep 17 00:00:00 2001 From: Agney Date: Sun, 15 Aug 2021 03:16:46 +0530 Subject: [PATCH] make sure the non existing tab is not displayed --- playground/src/__tests__/Editor.test.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/playground/src/__tests__/Editor.test.tsx b/playground/src/__tests__/Editor.test.tsx index acb6bab..98c16ca 100644 --- a/playground/src/__tests__/Editor.test.tsx +++ b/playground/src/__tests__/Editor.test.tsx @@ -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( { /> ); - 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(); }); });