diff --git a/__mocks__/fileMock.js b/__mocks__/fileMock.js new file mode 100644 index 0000000..86059f3 --- /dev/null +++ b/__mocks__/fileMock.js @@ -0,0 +1 @@ +module.exports = 'test-file-stub'; diff --git a/__tests__/Home.test.jsx b/__tests__/Home.test.jsx index bb0ea6f..667dce4 100644 --- a/__tests__/Home.test.jsx +++ b/__tests__/Home.test.jsx @@ -3,7 +3,7 @@ import { render, screen } from "@testing-library/react"; import { Provider } from "react-redux"; import configureStore from "redux-mock-store"; import Home from "src/pages/Home"; -import { useGetChatsQuery } from "../backend/redux/api_slice"; +import { useGetChatsQuery } from "src/backend/redux/api_slice"; // Mock Redux store const mockStore = configureStore([]); diff --git a/__tests__/SignIn.test.jsx b/__tests__/SignIn.test.jsx index 29204ba..d1597fd 100644 --- a/__tests__/SignIn.test.jsx +++ b/__tests__/SignIn.test.jsx @@ -1,14 +1,14 @@ import React from "react"; import { render, screen, fireEvent } from "@testing-library/react"; -import SignIn from "../pages/SignIn"; -import { displayMessage } from "../backend/notifications/notifications"; -import { post } from "../backend/api"; +import SignIn from "src/pages/SignIn"; +import { displayMessage } from "src/backend/notifications/notifications"; +import { post } from "src/backend/api"; // Mock the displayMessage and post functions -jest.mock("../backend/notifications/notifications", () => ({ +jest.mock("src/backend/notifications/notifications", () => ({ displayMessage: jest.fn(), })); -jest.mock("../backend/api", () => ({ +jest.mock("src/backend/api", () => ({ post: jest.fn(), })); diff --git a/jest.config.ts b/jest.config.ts index f158775..20bf4d6 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -20,6 +20,7 @@ const config: Config = { moduleNameMapper: { "^@/src/(.*)$": "/src/$1", // Map '@/src' to the 'src' folder "^src/(.*)$": "/src/$1", // Map 'src' to the 'src' folder + "\\.(svg|png|jpg|jpeg|gif)$": "/__mocks__/fileMock.js", // Add this line }, moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx', 'js', 'jsx'], }; diff --git a/jest.setup.ts b/jest.setup.ts index 2e44dbb..174490e 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -9,6 +9,9 @@ jest.mock('@brojs/cli', () => { }, getNavigationsValue(key) { return mockedConfig.navigations[key] + }, + getConfigValue(key) { + return mockedConfig.config[key] } } }) diff --git a/src.zip b/src.zip deleted file mode 100644 index 5f00fec..0000000 Binary files a/src.zip and /dev/null differ