Skip to content

Commit

Permalink
UADS-20 test: Added test cases for EventCard component
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsheel12 committed Jun 17, 2024
1 parent 7a5834b commit 4b1f211
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions web/src/components/__tests__/EventCard.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import EventCard, { EventType } from "../EventCard";

describe("Event Card Component", () => {
const event: EventType = {
id: 1,
date: "4",
month: "April",
title: "Meet and Greet",
description: "Come and meet your fellow peers and connect with each other",
};

it("Renders the EventCard component with correct details", () => {
render(<EventCard event={event} />);

expect(screen.getByText("4")).toBeInTheDocument();
expect(screen.getByText("April")).toBeInTheDocument();
expect(screen.getByText("Meet and Greet")).toBeInTheDocument();
expect(screen.getByText("Come and meet your fellow peers and connect with each other")).toBeInTheDocument();
});
});

0 comments on commit 4b1f211

Please sign in to comment.