Skip to content

Commit d6108a5

Browse files
committed
fix tests
1 parent 7d9deac commit d6108a5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

frontend/__tests__/Navbar/Navbar.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe("GlobalNavbar", () => {
8080
AuthStatus.Unauthorized,
8181
);
8282
render(<GlobalNavbar />);
83-
const brandLogo = screen.getByAltText("Find First logo");
83+
const brandLogo = screen.getByAltText("FindFirst Logo");
8484
expect(brandLogo).toBeInTheDocument();
8585
});
8686

@@ -162,7 +162,7 @@ describe("GlobalNavbar", () => {
162162
AuthStatus.Unauthorized,
163163
);
164164
render(<GlobalNavbar />);
165-
const brandLogo = screen.getByAltText("Find First logo");
165+
const brandLogo = screen.getByAltText("FindFirst Logo");
166166
await user.click(brandLogo);
167167
expect(mockPush).toHaveBeenCalledWith("/");
168168
});

frontend/__tests__/Navbar/Searchbar/Searchbar.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { SearchTypeChar } from "@components/Navbar/Searchbar";
22
import { render, screen } from "@testing-library/react";
33
import userEvent from "@testing-library/user-event";
44
import { MockedFunction, beforeEach, describe, expect, it, vi } from "vitest";
5-
import GlobalNavbar from "@components/Navbar/Navbar";
65
import {
76
backSpaceOnField,
87
click,
@@ -12,13 +11,18 @@ import useAuth from "@components/UseAuth";
1211
import { AuthStatus, User } from "@services/auth.service";
1312
import { instance } from "@api/Api";
1413
import { bkmkResp } from "../../data/SampleData";
14+
import GlobalNavbar from "@components/Navbar/Navbar";
1515

1616
const user = userEvent.setup();
1717
let mock: any;
1818
const data = JSON.stringify(bkmkResp);
1919
const urlB = "search/title";
2020

21-
const userAcc: User = { username: "jsmith", refreshToken: "blahblajhdfh34234" };
21+
const userAcc: User = {
22+
username: "jsmith",
23+
refreshToken: "blahblajhdfh34234",
24+
id: 0,
25+
};
2226

2327
vi.mock("next/navigation", () => ({
2428
useRouter: vi.fn(),

0 commit comments

Comments
 (0)