Skip to content

Commit

Permalink
Made test for short and long testimonial card
Browse files Browse the repository at this point in the history
  • Loading branch information
henryhlly committed Oct 1, 2024
1 parent 0545758 commit 5ca4ba0
Show file tree
Hide file tree
Showing 4 changed files with 13,875 additions and 9,921 deletions.
6 changes: 4 additions & 2 deletions frontend2/components/Home/PastEvents/PastEvent.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { render, screen } from '@/test-utils';
import { PastEvent } from './PastEvent';

describe('Banner component', () => {
// REMINDER: Make another test for 1 event and/or 3 events
describe('Default test for past event carousel', () => {
const ExampleEvent : PastEvent = {
events: [
{
Expand Down Expand Up @@ -41,10 +42,11 @@ describe('Banner component', () => {
render(
<PastEvent
events = {ExampleEvent.events}
// Unsure if 3 cards should always be shown
/>
);
ExampleEvent.events.forEach(event => {
expect(screen.getByText(event.eventName)).toBeInTheDocument();
expect(screen.getByText("Past Events")).toBeInTheDocument();
});
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { render, screen } from '@/test-utils';
import { TestimonialCard, Testimonial } from './TestimonialCard';

describe('Testing a long Testimonial Card', () => {
const placeholderTestimony : Testimonial = {
quote: `Joining ASPA has been one of the best parts of my university experience. Whether you're a beginner or a seasoned player,
there's always someone to share a game with and plenty of opportunities to improve your skills. The club’s friendly community
and regular events make it easy to meet new people and have a great time. ASPA isn’t just about pool; it’s about connecting with
like-minded students who share a passion for the game. I highly recommend it to anyone looking to have fun and learn along the way!`,
author: 'James Wellington, Senior Coordinator of Student Engagement and Event Management for the Auckland Student Pool Association, and Longstanding Club Member'
};
it('renders correctly', () => {
render(
<TestimonialCard
testimonial={placeholderTestimony}
/>
);
expect(screen.getByText(placeholderTestimony.quote)).toBeInTheDocument();
expect(screen.getByText(placeholderTestimony.author)).toBeInTheDocument();
});
});

describe('Testing a short Testimonial Card', () => {
const placeholderTestimony : Testimonial = {
quote: `Was good!`,
author: 'JT'
};
it('renders correctly', () => {
render(
<TestimonialCard
testimonial={placeholderTestimony}
/>
);
expect(screen.getByText(placeholderTestimony.quote)).toBeInTheDocument();
expect(screen.getByText(placeholderTestimony.author)).toBeInTheDocument();
});
});
Loading

0 comments on commit 5ca4ba0

Please sign in to comment.