From 68572dbd362cf1f5ce23cb1ba6d643f169716d87 Mon Sep 17 00:00:00 2001 From: Tharun Rajendran Date: Mon, 21 Mar 2022 21:55:54 +0530 Subject: [PATCH] chore(test): rewritten app component test using rtl (#4629) --- frontend/components/App/App.tests.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/components/App/App.tests.jsx b/frontend/components/App/App.tests.jsx index 345ffff330..f1594adbb7 100644 --- a/frontend/components/App/App.tests.jsx +++ b/frontend/components/App/App.tests.jsx @@ -1,4 +1,4 @@ -import { mount } from "enzyme"; +import { render } from "@testing-library/react"; import ConnectedApp from "./App"; import * as authActions from "../../redux/nodes/auth/actions"; @@ -10,14 +10,14 @@ const { connectedComponent, reduxMockStore } = helpers; describe("App - component", () => { const store = { app: {}, auth: {}, notifications: {} }; const mockStore = reduxMockStore(store); - const component = mount(connectedComponent(ConnectedApp, { mockStore })); + const component = render(connectedComponent(ConnectedApp, { mockStore })); afterEach(() => { local.setItem("auth_token", null); }); it("renders", () => { - expect(component).toBeTruthy(); + expect(component).not.toBeNull(); }); it("loads the current user if there is an auth token but no user", () => { @@ -33,7 +33,7 @@ describe("App - component", () => { }); const application = connectedComponent(ConnectedApp, { mockStore }); - mount(application); + render(application); expect(spy).toHaveBeenCalled(); }); @@ -60,7 +60,7 @@ describe("App - component", () => { mockStore: mockStoreWithUser, }); - mount(application); + render(application); expect(spy).not.toHaveBeenCalled(); }); @@ -74,7 +74,7 @@ describe("App - component", () => { }); const application = connectedComponent(ConnectedApp, { mockStore }); - mount(application); + render(application); expect(spy).not.toHaveBeenCalled(); }); });