Skip to content

Commit

Permalink
Fix issues from feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdentarikcan committed Dec 14, 2024
1 parent 9acbce7 commit 69b1cf3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from "react-router-dom";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { routeConfig } from ".";
import { BookmarkedQuestions } from "./bookmarked";
import { BookmarkedQuestions } from "./bookmarks";

// Mock the useGetBookmarkedQuestions hook
vi.mock("@/services/api/programmingForumComponents", () => ({
Expand Down Expand Up @@ -72,7 +72,7 @@ import {

it("should have no accessibility violations", async () => {
const router = createMemoryRouter(routeConfig, {
initialEntries: ["/bookmarked"],
initialEntries: ["/bookmarks"],
});

await testAccessibility(<RouterProvider router={router} />);
Expand All @@ -88,9 +88,9 @@ import {
} as QueryObserverSuccessResult<unknown, GetBookmarkedQuestionsError>);

render(
<MemoryRouter initialEntries={["/bookmarked"]}>
<MemoryRouter initialEntries={["/bookmarks"]}>
<Routes>
<Route path="/bookmarked" element={<BookmarkedQuestions />} />
<Route path="/bookmarks" element={<BookmarkedQuestions />} />
</Routes>
</MemoryRouter>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const BookmarkedQuestions = () => {
<div className="flex items-center justify-between">
<h1 className="text-2xl font-bold ">
{questions.length
? `Last ${resultListData.totalItems} bookmarked questions shown.`
: "No questions are bookmarked."}
? `You have ${resultListData.totalItems} bookmarked questions.`
: "You haven't bookmarked any questions."}
</h1>
</div>
{!questions.length && (
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import QuestionRoute from "./question";
import { Search } from "./search";
import Signup from "./signup";
import TagPage from "./tag";
import { BookmarkedQuestions } from "@/routes/bookmarked";
import { BookmarkedQuestions } from "@/routes/bookmarks";

export const routes: RouteObject[] = [
{
Expand All @@ -28,7 +28,7 @@ export const routes: RouteObject[] = [
Component: Login,
},
{
path: "/bookmarkedquestions",
path: "/bookmarks",
Component: BookmarkedQuestions,
},
{
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/routes/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ export default function Profile() {
{isPending ? "Saving..." : "Save"}
</Button>
) : (
<div style={{ display: 'flex', gap: '15px', justifyContent: 'center', alignItems: 'center' }}>
<div className="flex gap-4 justify-center items-center">
<Button onClick={() => setEditing(true)} variant="outline">
Edit Profile
</Button>
<Button asChild variant="outline">
<Link to="/bookmarkedquestions">Bookmarked Questions</Link>
<Link to="/bookmarks">Bookmarks</Link>
</Button>
</div>
)
Expand Down

0 comments on commit 69b1cf3

Please sign in to comment.