Rearrange mocks

This commit is contained in:
jwu-fisker
2021-01-06 20:12:15 -08:00
parent 527c7c2b7b
commit 4abeb0e9a0
4 changed files with 8 additions and 4 deletions

View File

@@ -1,7 +1,9 @@
jest.mock("../Contexts/UserContext");
jest.mock("../Contexts/UserContext");
import React from "react"; import React from "react";
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react" import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react"
jest.mock("../Contexts/UserContext");
import { useUserContext, UserProvider } from "../Contexts/UserContext"; import { useUserContext, UserProvider } from "../Contexts/UserContext";
import FileUploadForm from './index'; import FileUploadForm from './index';

View File

@@ -2,6 +2,7 @@ import React from "react";
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react" import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react"
jest.mock("../Contexts/UserContext"); jest.mock("../Contexts/UserContext");
import { useUserContext, UserProvider } from "../Contexts/UserContext"; import { useUserContext, UserProvider } from "../Contexts/UserContext";
import SignInForm from './index'; import SignInForm from './index';

View File

@@ -1,7 +1,8 @@
jest.mock("../Contexts/UserContext");
import React from "react"; import React from "react";
import { BrowserRouter } from 'react-router-dom'; import { BrowserRouter } from 'react-router-dom';
import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react" import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react"
jest.mock("../Contexts/UserContext");
import { useUserContext, UserProvider } from "../Contexts/UserContext"; import { useUserContext, UserProvider } from "../Contexts/UserContext";
import SignUpForm from './index'; import SignUpForm from './index';

View File

@@ -1,11 +1,11 @@
jest.mock("../../services/auth");
import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react" import {render, cleanup, screen, fireEvent, waitFor} from "@testing-library/react"
import { UserProvider, useUserContext } from "../Contexts/UserContext"; import { UserProvider, useUserContext } from "../Contexts/UserContext";
import auth from "../../services/auth"; import auth from "../../services/auth";
const TEST_TOKEN = { accessToken: { jwtToken: "TEST" }}; const TEST_TOKEN = { accessToken: { jwtToken: "TEST" }};
jest.mock("../../services/auth");
describe("UseContext", () => { describe("UseContext", () => {
describe("Signup", () => { describe("Signup", () => {