Skip to content

Commit

Permalink
Created test case for testimonial group
Browse files Browse the repository at this point in the history
  • Loading branch information
henryhlly committed Oct 2, 2024
1 parent f6fbecf commit 10bf476
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 28 deletions.
1 change: 0 additions & 1 deletion frontend2/components/Home/PastEvents/PastEvent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ describe('Default test for past event carousel', () => {
eventDescription: 'Enjoy a night of pure pool goodness at the Orange Club. $9 entry. Our execs will be there feel free to come say hi!',
imgUrl: '/event_example.svg'
},

]
}
it('renders correctly', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { render, screen } from '@/test-utils';
import { TestimonialGroup } from './TestimonialGroup';
import { Testimonial } from "../Card/TestimonialCard";

describe('Testing a testimonial group', () => {
const ExampleTestimonials: Testimonial[] = [
{
quote: 'Pool is such a cool game OMG.',
author: 'ASPA Member 1',
},
{
quote: 'Pool is such a cool game OMG.',
author: 'ASPA Member 2',
},
{
quote: 'Pool is such a cool game OMG.',
author: 'ASPA Member 3',
},
]

it('renders correctly', () => {
render(
<TestimonialGroup
testimonials={ExampleTestimonials}
/>
);
expect(screen.getByText(ExampleTestimonials[0].quote)).toBeInTheDocument();
expect(screen.getByText(ExampleTestimonials[0].author)).toBeInTheDocument();
expect(screen.getByText(ExampleTestimonials[1].quote)).toBeInTheDocument();
expect(screen.getByText(ExampleTestimonials[1].author)).toBeInTheDocument();
expect(screen.getByText(ExampleTestimonials[2].quote)).toBeInTheDocument();
expect(screen.getByText(ExampleTestimonials[2].author)).toBeInTheDocument();
});
});
Loading

0 comments on commit 10bf476

Please sign in to comment.