mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 07:42:10 +00:00
refactor: Update import statement for jest in setupTest.js
This commit updates the import statement for jest in the setupTest.js file. The previous import statement used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
This commit is contained in:
parent
e9c94876c0
commit
48e3c24c6e
@ -5,6 +5,7 @@ import Route from "Common/Types/API/Route";
|
||||
import URL from "Common/Types/API/URL";
|
||||
import Email from "Common/Types/Email";
|
||||
import * as React from "react";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
// Mock the Navigation module to avoid real navigation
|
||||
jest.mock("../../Utils/Navigation", () => {
|
||||
|
@ -2,6 +2,7 @@ import Alert, { AlertType } from "../../Components/Alerts/Alert";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
describe("alert tests", () => {
|
||||
test("it should render all props passed", () => {
|
||||
|
@ -2,6 +2,7 @@ import Badge, { BadgeType } from "../../Components/Badge/Badge";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { describe, expect, test } from "@jest/globals";
|
||||
|
||||
describe("Badge", () => {
|
||||
test("it should render all props", () => {
|
||||
|
@ -8,6 +8,7 @@ import userEvent from "@testing-library/user-event";
|
||||
import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import * as React from "react";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
describe("BasicForm test", () => {
|
||||
const fields: Fields<FormValues<any>> = [
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Breadcrumbs from "../../Components/Breadcrumbs/Breadcrumbs";
|
||||
import Navigation from "../../Utils/Navigation";
|
||||
import { describe, expect, test } from "@jest/globals";
|
||||
import { describe, expect, test, jest } from "@jest/globals";
|
||||
import Route from "Common/Types/API/Route";
|
||||
import Link from "Common/Types/Link";
|
||||
import * as React from "react";
|
||||
|
@ -8,6 +8,7 @@ import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import IconProp from "Common/Types/Icon/IconProp";
|
||||
import React from "react";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
describe("Button", () => {
|
||||
test("it should render correctly with title and icon", () => {
|
||||
|
@ -7,6 +7,7 @@ import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import IconProp from "Common/Types/Icon/IconProp";
|
||||
import React, { ReactElement } from "react";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
describe("Card", () => {
|
||||
const props: ComponentProps = {
|
||||
|
@ -3,6 +3,7 @@ import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render } from "@testing-library/react";
|
||||
import Color from "Common/Types/Color";
|
||||
import * as React from "react";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
describe("Color Viewer", () => {
|
||||
test("Render the component", () => {
|
||||
|
@ -10,7 +10,6 @@ import ComponentMetadata, {
|
||||
} from "Common/Types/Workflow/Component";
|
||||
import React from "react";
|
||||
|
||||
|
||||
/// @dev we use different UUID for (id & title), description, and category to ensure that the component is unique
|
||||
|
||||
type GetComponentMetadataFunction = (category?: string) => ComponentMetadata;
|
||||
|
@ -2,7 +2,7 @@ import Dropdown, { DropdownOption } from "../../Components/Dropdown/Dropdown";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import React from "react";
|
||||
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
describe("Dropdown", () => {
|
||||
const options: DropdownOption[] = [
|
||||
{ value: "1", label: "1" },
|
||||
|
@ -1,7 +1,7 @@
|
||||
import DuplicateModel from "../../Components/DuplicateModel/DuplicateModel";
|
||||
import { ModelField } from "../../Components/Forms/ModelForm";
|
||||
import Select from "../../Utils/BaseDatabase/Select";
|
||||
import { describe, expect, it } from "@jest/globals";
|
||||
import { describe, expect, it, jest } from "@jest/globals";
|
||||
import {
|
||||
fireEvent,
|
||||
render,
|
||||
|
@ -3,8 +3,7 @@ import "@testing-library/jest-dom/extend-expect";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import Color from "Common/Types/Color";
|
||||
import React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
|
||||
import { describe, expect, test } from "@jest/globals";
|
||||
|
||||
describe("Loader tests", () => {
|
||||
test("it should render if bar loader show up", () => {
|
||||
|
@ -5,7 +5,7 @@ import { describe, expect, it } from "@jest/globals";
|
||||
import "@testing-library/jest-dom";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
describe("OrderedSateList", () => {
|
||||
interface ItemData {
|
||||
|
@ -5,7 +5,7 @@ import { describe, expect, it } from "@jest/globals";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, jest } from "@jest/globals";
|
||||
|
||||
describe("Pagination", () => {
|
||||
it("renders Component", () => {
|
||||
|
@ -3,7 +3,7 @@ import "@testing-library/jest-dom/extend-expect";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import Color from "Common/Types/Color";
|
||||
import * as React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, test } from "@jest/globals";
|
||||
|
||||
describe("<Pill />", () => {
|
||||
test("Checking text", () => {
|
||||
|
@ -4,7 +4,7 @@ import { render, screen } from "@testing-library/react";
|
||||
import ObjectID from "Common/Types/ObjectID";
|
||||
import Probe from "Model/Models/Probe";
|
||||
import * as React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, test } from "@jest/globals";
|
||||
|
||||
describe("ProbeElement Component", () => {
|
||||
const mockProbe: Probe = new Probe();
|
||||
|
@ -2,7 +2,7 @@ import ProgressBar from "../../Components/ProgressBar/ProgressBar";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import * as React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, test } from "@jest/globals";
|
||||
|
||||
describe("ProgressBar Component", () => {
|
||||
function getProgressBar(): HTMLElement {
|
||||
|
@ -4,7 +4,7 @@ import RadioButtons, {
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, jest, test } from "@jest/globals";
|
||||
|
||||
describe("RadioButtons", () => {
|
||||
const options: RadioButton[] = [
|
||||
|
@ -2,7 +2,7 @@ import SideOver, { ComponentProps } from "../../Components/SideOver/SideOver";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import React, { ReactElement } from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, jest, test } from "@jest/globals";
|
||||
|
||||
describe("SideOver", () => {
|
||||
const childElementText: string = "child element";
|
||||
|
@ -3,7 +3,7 @@ import Tabs from "../../Components/Tabs/Tabs";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, jest, test } from "@jest/globals";
|
||||
|
||||
describe("Tabs", () => {
|
||||
const activeClass: string = "bg-gray-100 text-gray-700";
|
||||
|
@ -2,7 +2,7 @@ import TextArea from "../../Components/TextArea/TextArea";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { fireEvent, render } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, test, jest } from "@jest/globals";
|
||||
|
||||
describe("TextArea", () => {
|
||||
test("renders textarea element with initialValue only", () => {
|
||||
|
@ -5,7 +5,7 @@ import userEvent from "@testing-library/user-event";
|
||||
import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup";
|
||||
import OneUptimeDate from "Common/Types/Date";
|
||||
import * as React from "react";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, test } from "@jest/globals";
|
||||
|
||||
describe("Test for Toast.tsx", () => {
|
||||
test("should render the component", () => {
|
||||
|
@ -5,7 +5,7 @@ import Hostname from "Common/Types/API/Hostname";
|
||||
import BadDataException from "Common/Types/Exception/BadDataException";
|
||||
import IPv4 from "Common/Types/IP/IPv4";
|
||||
import PositiveNumber from "Common/Types/PositiveNumber";
|
||||
import { describe, expect } from "@jest/globals";
|
||||
import { describe, expect, jest, test } from "@jest/globals";
|
||||
|
||||
describe("Ping", () => {
|
||||
jest.setTimeout(240000);
|
||||
|
@ -194,6 +194,7 @@ export default tseslint.config(
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
JSX: true,
|
||||
},
|
||||
parserOptions: {
|
||||
project: ["./tsconfig.json"], // Specify it only for TypeScript files
|
||||
|
Loading…
Reference in New Issue
Block a user