refactor: Update import statements for jest in test files

This commit is contained in:
Simon Larsen 2024-06-14 14:24:45 +01:00
parent 34c5cb1e94
commit 4c4169e245
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA
6 changed files with 20 additions and 7 deletions

View File

@ -24,7 +24,14 @@ import {
UserTenantAccessPermission,
} from "Common/Types/Permission";
import Project from "Model/Models/Project";
import { describe, expect, beforeEach, test, afterEach, jest } from "@jest/globals";
import {
describe,
expect,
beforeEach,
test,
afterEach,
jest,
} from "@jest/globals";
jest.mock("../../Utils/Logger");
jest.mock("../../Middleware/ProjectAuthorization");

View File

@ -8,7 +8,14 @@ import AnalyticsTableEngine from "Common/Types/AnalyticsDatabase/AnalyticsTableE
import AnalyticsTableColumn from "Common/Types/AnalyticsDatabase/TableColumn";
import TableColumnType from "Common/Types/AnalyticsDatabase/TableColumnType";
import GenericObject from "Common/Types/GenericObject";
import { describe, expect, beforeEach, test, afterEach, jest } from "@jest/globals";
import {
describe,
expect,
beforeEach,
test,
afterEach,
jest,
} from "@jest/globals";
describe("AnalyticsDatabaseService", () => {
class TestModel extends AnalyticsBaseModel {

View File

@ -1,12 +1,11 @@
import { ButtonStyleType } from "../../Components/Button/Button";
import Item, { ComponentProps } from "../../Components/OrderedStatesList/Item";
import { describe, expect, jest } from "@jest/globals";
import { describe, expect, jest } from "@jest/globals";
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import IconProp from "Common/Types/Icon/IconProp";
import React from "react";
describe("Item component", () => {
interface ItemData {
id: number;

View File

@ -5,7 +5,7 @@ import SideMenuItem, {
ComponentProps,
} from "../../Components/SideMenu/SideMenuItem";
import * as Navigation from "../../Utils/Navigation";
import { describe, expect,afterEach, jest } from "@jest/globals";
import { describe, expect, afterEach, jest } from "@jest/globals";
import "@testing-library/jest-dom/extend-expect";
import { fireEvent, render, screen } from "@testing-library/react";
// Types
@ -13,7 +13,6 @@ import Route from "Common/Types/API/Route";
import IconProp from "Common/Types/Icon/IconProp";
import React from "react";
const highlightClassList: string =
"bg-gray-100 text-indigo-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium";

View File

@ -2,7 +2,7 @@ import Toggle from "../../Components/Toggle/Toggle";
import "@testing-library/jest-dom/extend-expect";
import { fireEvent, render } from "@testing-library/react";
import React from "react";
import { describe, expect, beforeEach, test, afterEach, jest } from "@jest/globals";
import { describe, expect, test, jest } from "@jest/globals";
describe("Toggle", () => {
test("renders toggle element with required props only", () => {

View File

@ -194,6 +194,7 @@ export default tseslint.config(
globals: {
...globals.browser,
...globals.node,
...globals.jest,
JSX: true,
},
parserOptions: {