From a5f6d3ae3560829ce7709c3696027474ebb8d6c6 Mon Sep 17 00:00:00 2001 From: Asiern Date: Wed, 7 Feb 2024 11:16:12 +0100 Subject: [PATCH] fix: tests --- __tests__/components/Run/Run.test.js | 30 ++++++---------------------- __tests__/screens/profile/PB.test.js | 3 ++- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/__tests__/components/Run/Run.test.js b/__tests__/components/Run/Run.test.js index 042370bc..1314c78d 100644 --- a/__tests__/components/Run/Run.test.js +++ b/__tests__/components/Run/Run.test.js @@ -15,44 +15,26 @@ beforeAll(() => { describe("Run component", () => { it("displays place correctly", async () => { - const { getByText } = render( - - ); + const { getByText } = render(); const place = getByText("20"); expect(place).toBeDefined(); }); it("displays time correctly", async () => { - const time = "1h22m5s"; + const time = "00:31:22"; const { getByText } = render( - + ); const timeComp = getByText(time); expect(timeComp).toBeDefined(); }); it("navigates to RunInfo screen when pressed", () => { - const { getByTestId } = render( - - ); + const { getByTestId } = render(); const touchable = getByTestId("run-touchable"); fireEvent.press(touchable); const navigation = useNavigation(); expect(navigation.navigate).toHaveBeenCalledWith("RunInfo", { - weblink: runData.weblink, + run: runData, + place: 20, }); }); }); diff --git a/__tests__/screens/profile/PB.test.js b/__tests__/screens/profile/PB.test.js index 98b615a0..34495e9d 100644 --- a/__tests__/screens/profile/PB.test.js +++ b/__tests__/screens/profile/PB.test.js @@ -36,7 +36,8 @@ describe("PB component", () => { const navigation = useNavigation(); expect(navigation.navigate).toBeCalledWith("RunInfo", { - weblink: pbData.run.weblink, + run: pbData.run, + place: pbData.place, }); }); });