Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5035085
docs:added description to each file so the new user know what to do
shadil-rayyan May 26, 2025
ff09ca2
Fixed dependency vulnerabilities
FahadLive Jun 6, 2025
a06b3c5
Temporarily removed Dark mode and started working on timetable and qu…
FahadLive Jun 6, 2025
3f291cf
Fixed top and bottom nav bar
FahadLive Jun 9, 2025
d42ad8c
Fixed calender view
FahadLive Jun 9, 2025
d4b2c0a
Adapted height to fit smaller screen sizes (Might need tweaking)
FahadLive Jun 9, 2025
2b30028
Centered content on large screens
FahadLive Jun 10, 2025
7f8b293
Added basic test cases for Responsive Dashboard
FahadLive Jun 12, 2025
da4c93a
Fixed test cases for navigation bars & fixed typo in file name
FahadLive Jun 12, 2025
bff5e3b
Fixed visuals of timetable
FahadLive Jun 13, 2025
798d6cf
Changed quick actions and responsive dashboard
FahadLive Jun 13, 2025
7c04c16
I changeed the ui look of lost and found to add lost items as per de…
DiyaBetcy Jun 15, 2025
1281610
Added BackArrow and filter icon, Left Alignment
Sayoojya-K-S Jun 17, 2025
42db8ff
Merge pull request #5 from Ranger-NF/main
shadil-rayyan Jun 19, 2025
92635f1
fixed conflict
shadil-rayyan Jun 19, 2025
e9a724c
fixing build errro of fireabsae pacakges
shadil-rayyan Jun 19, 2025
665b8e7
merge main
shadil-rayyan Jun 19, 2025
3829751
Merge pull request #10 from Sayoojya-K-S/lostfound-page-update
shadil-rayyan Jun 19, 2025
a664270
Updated club page
Ruba466 Jun 26, 2025
81de4db
Updated club page
Ruba466 Jun 26, 2025
388d68c
Updated statuc club data
Ruba466 Jun 26, 2025
3150845
Updated static club data
Ruba466 Jun 26, 2025
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
62 changes: 62 additions & 0 deletions __test__/__snapshots__/bottomnavbar.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`BottomNavBar Component matches snapshot 1`] = `
<DocumentFragment>
<nav
class="fixed left-6 right-6 bottom-8 border-t border-gray-300 bg-[var(--main)] text-foreground rounded-2xl"
>
<ul
class="flex items-center justify-around py-2"
>
<li
class="flex flex-col items-center"
>
<button
class="focus:outline-none"
type="button"
>
<div
data-testid="home-icon"
/>
</button>
</li>
<li
class="flex flex-col items-center"
>
<button
class="focus:outline-none"
type="button"
>
<div
data-testid="book-icon"
/>
</button>
</li>
<li
class="flex flex-col items-center"
>
<button
class="focus:outline-none"
type="button"
>
<div
data-testid="calendar-icon"
/>
</button>
</li>
<li
class="flex flex-col items-center"
>
<button
class="focus:outline-none"
type="button"
>
<div
data-testid="money-icon"
/>
</button>
</li>
</ul>
</nav>
</DocumentFragment>
`;
71 changes: 71 additions & 0 deletions __test__/bottomnavbar.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { render, screen } from "@testing-library/react";
import BottomNavBar from "@/components/bottomNavbar";
import { Book, Calendar2, Home2, Money } from "iconsax-react";

// Mock the icons to verify they're rendered
jest.mock("iconsax-react", () => ({
Book: jest.fn(() => <div data-testid="book-icon" />),
Calendar2: jest.fn(() => <div data-testid="calendar-icon" />),
Home2: jest.fn(() => <div data-testid="home-icon" />),
Money: jest.fn(() => <div data-testid="money-icon" />),
}));

describe("BottomNavBar Component", () => {
beforeEach(() => {
jest.clearAllMocks();
});

it("renders without crashing", () => {
render(<BottomNavBar />);
expect(screen.getByRole("navigation")).toBeInTheDocument();
});

it("has correct styling classes", () => {
render(<BottomNavBar />);
const nav = screen.getByRole("navigation");

expect(nav).toHaveClass("fixed");
expect(nav).toHaveClass("bottom-8");
expect(nav).toHaveClass("rounded-2xl");
expect(nav).toHaveClass("bg-[var(--main)]");
});

it("renders all navigation items", () => {
render(<BottomNavBar />);

const listItems = screen.getAllByRole("listitem");
expect(listItems).toHaveLength(4);

const buttons = screen.getAllByRole("button");
expect(buttons).toHaveLength(4);
});

it("renders correct icons for each nav item", () => {
render(<BottomNavBar />);

expect(Home2).toHaveBeenCalled();
expect(Book).toHaveBeenCalled();
expect(Calendar2).toHaveBeenCalled();
expect(Money).toHaveBeenCalled();

// Verify icon props
const homeIconProps = (Home2 as jest.Mock).mock.calls[0][0];
expect(homeIconProps.size).toBe("32");
expect(homeIconProps.color).toBe("var(--text)");
});

it("has accessible buttons", () => {
render(<BottomNavBar />);

const buttons = screen.getAllByRole("button");
buttons.forEach((button) => {
expect(button).toHaveAttribute("type", "button");
expect(button).toHaveClass("focus:outline-none");
});
});

it("matches snapshot", () => {
const { asFragment } = render(<BottomNavBar />);
expect(asFragment()).toMatchSnapshot();
});
});
63 changes: 63 additions & 0 deletions __test__/home.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import ResponsiveDashboard from "@/components/home/ResponsiveDashboard";

describe("ResponsiveDashboard", () => {
beforeEach(() => {
jest.clearAllMocks();
});

it("renders without crashing", () => {
render(<ResponsiveDashboard />);
expect(screen.getByTestId("quick-actions")).toBeInTheDocument();
expect(screen.getByTestId("timetable-block")).toBeInTheDocument();
});

it("has correct layout structure", () => {
const { container } = render(<ResponsiveDashboard />);

// Check main container classes
const mainContainer = container.querySelector(".min-h-screen");
expect(mainContainer).toBeInTheDocument();

// Check max-width container
const maxWidthContainer = container.querySelector(".max-w-7xl");
expect(maxWidthContainer).toBeInTheDocument();

// Check flex container for md screens
const flexContainer = container.querySelector(".md\\:flex");
expect(flexContainer).toBeInTheDocument();
});

it("applies responsive classes correctly", () => {
const { container } = render(<ResponsiveDashboard />);

// Check section has responsive height classes
const section = container.querySelector("section");
expect(section).toHaveClass(
"h-[64vh]",
"sm:h-[55vh]",
"md:h-full",
"md:w-1/2",
);
});

it("renders both child components", () => {
render(<ResponsiveDashboard />);

// Verify both components are rendered
expect(screen.getByTestId("quick-actions")).toBeInTheDocument();
expect(screen.getByTestId("timetable-block")).toBeInTheDocument();
});

it("has proper semantic HTML structure", () => {
const { container } = render(<ResponsiveDashboard />);

// Check for semantic elements
const main = container.querySelector("main");
const section = container.querySelector("section");

expect(main).toBeInTheDocument();
expect(section).toBeInTheDocument();
});
});
Loading