File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ import '@testing-library/jest-dom';
22import { render , screen } from '@testing-library/react' ;
33import Home from '@/app/page' ;
44
5- it ( 'renders main page with the text "Get started by editing" ' , ( ) => {
5+ it ( 'renders 6 change logs ' , ( ) => {
66 render ( < Home /> ) ;
7- const login = screen . getAllByText ( / \b L o g i n \b / i ) . length ;
8- expect ( login ) . toBe ( 2 ) ;
9-
10- const register = screen . getAllByText ( / \b R e g i s t e r \b / i ) . length ;
11- expect ( register ) . toBe ( 2 ) ;
7+ // Finds all p tags with date logs
8+ const numListItems = screen
9+ . getByTestId ( 'changelog' )
10+ . querySelectorAll ( 'p' ) . length ;
11+ expect ( numListItems ) . toBe ( 6 ) ;
1212} ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ export default function Home() {
2323 programming contest problems. Polygon supports the whole development
2424 cycle:
2525 </ Typography >
26- { /* The following has to have a list using Tailwind CSS */ }
2726 < ul className = 'list-disc list-inside' >
2827 < li > problem statement writing</ li >
2928 < li > test data preparing (generators supported)</ li >
@@ -44,7 +43,7 @@ export default function Home() {
4443 Invokers waiting: { serviceSummary . numInvokers }
4544 </ Typography >
4645 </ Paper >
47- < Paper sx = { { p : 2 } } elevation = { 3 } >
46+ < Paper sx = { { p : 2 } } elevation = { 3 } data-testid = 'changelog' >
4847 { changeLogs . map ( ( log , index ) => (
4948 < Typography key = { index } variant = 'body2' >
5049 { log }
You can’t perform that action at this time.
0 commit comments