diff --git a/src/components/AppBar/tests/Logo.test.tsx b/src/components/AppBar/tests/Logo.test.tsx index 1aea4287d6..ba558672c4 100644 --- a/src/components/AppBar/tests/Logo.test.tsx +++ b/src/components/AppBar/tests/Logo.test.tsx @@ -24,6 +24,6 @@ beforeAll(() => { describe("Logo", () => { it("navigates to Project Screen on click", () => { testRenderer.root.findByType(Button).props.onClick(); - expect(mockNavigate).toBeCalledWith(Path.ProjScreen); + expect(mockNavigate).toHaveBeenCalledWith(Path.ProjScreen); }); }); diff --git a/src/components/DataEntry/tests/index.test.tsx b/src/components/DataEntry/tests/index.test.tsx index 0e272443c8..b2fddd36f6 100644 --- a/src/components/DataEntry/tests/index.test.tsx +++ b/src/components/DataEntry/tests/index.test.tsx @@ -74,7 +74,7 @@ describe("DataEntry", () => { it("fetches domain", async () => { await renderDataEntry({ currentDomain: mockDomain }); - expect(mockGetSemanticDomainFull).toBeCalledWith( + expect(mockGetSemanticDomainFull).toHaveBeenCalledWith( mockDomain.id, mockDomain.lang ); diff --git a/src/components/Login/tests/Login.test.tsx b/src/components/Login/tests/Login.test.tsx index 35dc189d4c..6512e99de8 100644 --- a/src/components/Login/tests/Login.test.tsx +++ b/src/components/Login/tests/Login.test.tsx @@ -68,7 +68,7 @@ describe("Login", () => { }); expect(fieldPass.props.error).toBeFalsy(); expect(fieldUser.props.error).toBeTruthy(); - expect(mockAsyncLogIn).not.toBeCalled(); + expect(mockAsyncLogIn).not.toHaveBeenCalled(); }); it("errors when no password", async () => { @@ -82,7 +82,7 @@ describe("Login", () => { }); expect(fieldPass.props.error).toBeTruthy(); expect(fieldUser.props.error).toBeFalsy(); - expect(mockAsyncLogIn).not.toBeCalled(); + expect(mockAsyncLogIn).not.toHaveBeenCalled(); }); it("submits when username and password", async () => { @@ -97,7 +97,7 @@ describe("Login", () => { }); expect(fieldPass.props.error).toBeFalsy(); expect(fieldUser.props.error).toBeFalsy(); - expect(mockAsyncLogIn).toBeCalled(); + expect(mockAsyncLogIn).toHaveBeenCalled(); }); }); }); diff --git a/src/components/Login/tests/Signup.test.tsx b/src/components/Login/tests/Signup.test.tsx index b12429a002..3dd5580fd5 100644 --- a/src/components/Login/tests/Signup.test.tsx +++ b/src/components/Login/tests/Signup.test.tsx @@ -88,9 +88,9 @@ const submitAndCheckError = async (id?: SignupId): Promise => { // Expect signUp only when no field expected to error. if (id === undefined) { - expect(mockAsyncSignUp).toBeCalled(); + expect(mockAsyncSignUp).toHaveBeenCalled(); } else { - expect(mockAsyncSignUp).not.toBeCalled(); + expect(mockAsyncSignUp).not.toHaveBeenCalled(); } }; diff --git a/src/components/ProjectSettings/tests/ProjectAutocomplete.test.tsx b/src/components/ProjectSettings/tests/ProjectAutocomplete.test.tsx index 2dc8125d2c..171bd52b87 100644 --- a/src/components/ProjectSettings/tests/ProjectAutocomplete.test.tsx +++ b/src/components/ProjectSettings/tests/ProjectAutocomplete.test.tsx @@ -29,12 +29,12 @@ describe("ProjectAutocomplete", () => { await renderAutocomplete(); const selectChange = testRenderer.root.findByType(Select).props.onChange; await renderer.act(async () => selectChange({ target: { value: "Off" } })); - expect(mockUpdateProject).toBeCalledWith({ + expect(mockUpdateProject).toHaveBeenCalledWith({ ...mockProject, autocompleteSetting: AutocompleteSetting.Off, }); await renderer.act(async () => selectChange({ target: { value: "On" } })); - expect(mockUpdateProject).toBeCalledWith({ + expect(mockUpdateProject).toHaveBeenCalledWith({ ...mockProject, autocompleteSetting: AutocompleteSetting.On, }); diff --git a/src/components/ProjectSettings/tests/ProjectLanguages.test.tsx b/src/components/ProjectSettings/tests/ProjectLanguages.test.tsx index dc7b504286..56b5ab45bc 100644 --- a/src/components/ProjectSettings/tests/ProjectLanguages.test.tsx +++ b/src/components/ProjectSettings/tests/ProjectLanguages.test.tsx @@ -103,7 +103,7 @@ describe("ProjectLanguages", () => { .findByProps({ id: "analysis-language-new-confirm" }) .props.onClick(); }); - expect(mockUpdateProject).toBeCalledWith( + expect(mockUpdateProject).toHaveBeenCalledWith( mockProject([...mockAnalysisWritingSystems, newLang]) ); }); diff --git a/src/components/ProjectSettings/tests/ProjectName.test.tsx b/src/components/ProjectSettings/tests/ProjectName.test.tsx index bf2fe3a1cb..f775aa01f2 100644 --- a/src/components/ProjectSettings/tests/ProjectName.test.tsx +++ b/src/components/ProjectSettings/tests/ProjectName.test.tsx @@ -37,7 +37,7 @@ describe("ProjectName", () => { textField.props.onChange({ target: { value: name } }) ); await renderer.act(async () => saveButton.props.onClick()); - expect(mockUpdateProject).toBeCalledWith({ ...mockProject, name }); + expect(mockUpdateProject).toHaveBeenCalledWith({ ...mockProject, name }); }); it("toasts on error", async () => { diff --git a/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx b/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx index 19eebad99b..a92768ff60 100644 --- a/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx +++ b/src/components/TreeView/Redux/tests/TreeViewActions.test.tsx @@ -72,7 +72,7 @@ describe("TreeViewActions", () => { treeViewState: nonDefaultState, }); await store.dispatch(initTreeDomain(mockLang)); - expect(mockGetSemDomTreeNode).toBeCalledWith(mockId, mockLang); + expect(mockGetSemDomTreeNode).toHaveBeenCalledWith(mockId, mockLang); }); }); }); diff --git a/src/utilities/tests/dictionaryLoader.test.ts b/src/utilities/tests/dictionaryLoader.test.ts index 9d84027bc3..f14a4b9d50 100644 --- a/src/utilities/tests/dictionaryLoader.test.ts +++ b/src/utilities/tests/dictionaryLoader.test.ts @@ -17,7 +17,7 @@ describe("DictionaryLoader", () => { const loader = new DictionaryLoader(bcp47); expect(loader.lang === bcp47); expect(mockGetKeys).toHaveBeenCalledTimes(1); - expect(mockGetKeys).toBeCalledWith(bcp47); + expect(mockGetKeys).toHaveBeenCalledWith(bcp47); }); });