generated from UoaWDCC/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UADS-20 test: Added test cases for EventCard component
- Loading branch information
1 parent
7a5834b
commit 4b1f211
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); |