Skip to content

Commit

Permalink
fix : code smell
Browse files Browse the repository at this point in the history
  • Loading branch information
AkekoChan committed Jan 12, 2024
1 parent a8c1975 commit 716afe2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 44 deletions.
37 changes: 0 additions & 37 deletions src/__tests__/Login.test.jsx
Original file line number Diff line number Diff line change
@@ -1,37 +0,0 @@
// import React from "react";
// import { render } from "@testing-library/react";
// import { useAuthContext } from "../context/authContext";

// import Login from "../components/login/Login";

// jest.mock("../context/authContext", () => ({
// useAuthContext: jest.fn(),
// }));

// describe("Login component", () => {
// test("renders without error", () => {
// useAuthContext.mockReturnValue({ userToken: null });
// render(<Login />);
// });

// test("displays login form", () => {
// useAuthContext.mockReturnValue({ userToken: null });
// const { getByRole } = render(<Login />);
// const form = getByRole("form");
// expect(form).toBeInTheDocument();
// });

// test("displays logged in message if user is already logged in", () => {
// useAuthContext.mockReturnValue({ userToken: "some_token" });
// const { getByText } = render(<Login />);
// const message = getByText("You are already logged in.");
// expect(message).toBeInTheDocument();
// });

// test("displays dashboard link if user is already logged in", () => {
// useAuthContext.mockReturnValue({ userToken: "some_token" });
// const { getByRole } = render(<Login />);
// const link = getByRole("link", { name: "Go to dashboard" });
// expect(link).toBeInTheDocument();
// });
// });
1 change: 0 additions & 1 deletion src/components/header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Link } from "react-router-dom";

import { useAuthContext } from "../../context/authContext";

import useFetch from "../../hook/useFetch";
import SubHeader from "./subheader/SubHeader.jsx";

import {
Expand Down
5 changes: 1 addition & 4 deletions src/components/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
gap: 1rem;
}

.header__item--credits {
margin-left: auto;
}

.header__logo {
width: 8rem;
height: 4rem;
Expand All @@ -30,6 +26,7 @@
display: flex;
gap: 0.25rem;
align-items: center;
margin-left: auto;
}

.header__credits {
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigate/Navigate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
FloatingOverlay,
} from "@floating-ui/react";

import { formatFirstLetterToUpperCase, distance } from "../../utils";
import { formatFirstLetterToUpperCase } from "../../utils";
import { useShipContext } from "../../context/shipContext";
import NavigateRow from "./navigaterow/NavigateRow.jsx";
import { CloseOutlined } from "@ant-design/icons";
Expand Down
2 changes: 1 addition & 1 deletion src/context/shipContext.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, useContext, useState, useEffect } from "react";
import { createContext, useContext, useState } from "react";
import { useAuthContext } from "./authContext";
import { fetchData } from "../utils";

Expand Down

0 comments on commit 716afe2

Please sign in to comment.