Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made sidebar + header bar sticky #35

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions backend/tests/video.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ describe("Video Controller - Get Videos", () => {
//tests create video
describe("Video Controller - Create Video", () => {
it("should create a new video", async () => {
const res = await request(app)
.post("/api/videos")
.send({
title: "New Video",
description: "New Description",
published: true,
});
const res = await request(app).post("/api/videos").send({
title: "New Video",
description: "New Description",
published: true,
});

expect(res.status).toBe(201);
expect(res.body.success).toBe(true);
Expand All @@ -66,13 +64,11 @@ describe("Video Controller - Update Video", () => {
published: false,
});

const res = await request(app)
.put(`/api/videos/${video._id}`)
.send({
title: "Updated Title",
description: "Updated Desc",
published: true,
});
const res = await request(app).put(`/api/videos/${video._id}`).send({
title: "Updated Title",
description: "Updated Desc",
published: true,
});

expect(res.status).toBe(200);
expect(res.body.success).toBe(true);
Expand Down
24 changes: 10 additions & 14 deletions backend/tests/video.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ describe("Video Controller - Get Videos", () => {
//tests create video
describe("Video Controller - Create Video", () => {
it("should create a new video", async () => {
const res = await request(app)
.post("/api/videos")
.send({
title: "New Video",
description: "New Description",
published: true,
});
const res = await request(app).post("/api/videos").send({
title: "New Video",
description: "New Description",
published: true,
});

expect(res.status).toBe(201);
expect(res.body.success).toBe(true);
Expand All @@ -65,13 +63,11 @@ describe("Video Controller - Update Video", () => {
published: false,
});

const res = await request(app)
.put(`/api/videos/${video._id}`)
.send({
title: "Updated Title",
description: "Updated Desc",
published: true,
});
const res = await request(app).put(`/api/videos/${video._id}`).send({
title: "Updated Title",
description: "Updated Desc",
published: true,
});

expect(res.status).toBe(200);
expect(res.body.success).toBe(true);
Expand Down
25 changes: 18 additions & 7 deletions frontend/src/routes/appRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,24 @@ function AppRoutes() {
<div style={{ width: "100%" }}>
<HeaderBar isOpen={isHeaderBarOpen} setIsOpen={setIsHeaderBarOpen} />
</div>
<div style={{ display: "flex", flex: 1 }}>
<div style={{ display: "flex", alignItems: "center" }}>
<Sidebar
isCollapsed={isCollapsed}
setIsCollapsed={setIsCollapsed}
/>
</div>
<div
style={{
position: "absolute",
display: "flex",
alignItems: "center",
top: "25%",
}}
>
<Sidebar isCollapsed={isCollapsed} setIsCollapsed={setIsCollapsed} />
</div>
<div
style={{
display: "flex",
flex: 1,
overflow: "auto",
paddingLeft: isCollapsed ? "6rem" : "17rem",
}}
>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/catalog" element={<Catalog />} />
Expand Down