@@ -26,19 +26,25 @@ describe("Events tests", () => {
2626 for ( let i = 0 ; i < rows . length ; i ++ ) {
2727 const row = rows [ i ] ;
2828 const expectedData = expectedTableData [ i ] ;
29- const title = await row . locator ( "td:nth-child(1)" ) . innerText ( ) ;
30- const location = await row . locator ( "td:nth-child(4)" ) . innerText ( ) ;
31- const description = await row . locator ( "td:nth-child(5)" ) . innerText ( ) ;
32- const host = await row . locator ( "td:nth-child(6)" ) . innerText ( ) ;
33- const featured = await row . locator ( "td:nth-child(7)" ) . innerText ( ) ;
34- const repeats = await row . locator ( "td:nth-child(8)" ) . innerText ( ) ;
35-
36- expect ( title ) . toEqual ( expectedData . title ) ;
37- expect ( location ) . toEqual ( expectedData . location ) ;
38- expect ( description ) . toEqual ( expectedData . description ) ;
39- expect ( host ) . toEqual ( expectedData . host ) ;
40- expect ( featured ) . toEqual ( expectedData . featured ? "Yes" : "No" ) ;
41- expect ( repeats ) . toEqual ( capitalizeFirstLetter ( expectedData . repeats ) ) ;
29+
30+ const title = ( await row . locator ( "td:nth-child(1)" ) . innerText ( ) ) . trim ( ) ;
31+ const location = (
32+ await row . locator ( "td:nth-child(4)" ) . innerText ( )
33+ ) . trim ( ) ;
34+ const host = ( await row . locator ( "td:nth-child(5)" ) . innerText ( ) ) . trim ( ) ;
35+ const repeats = ( await row . locator ( "td:nth-child(6)" ) . innerText ( ) ) . trim ( ) ;
36+
37+ let expectedTitle = expectedData . title ;
38+ if ( expectedData . featured ) {
39+ expectedTitle = `${ expectedData . title } \nFEATURED` ;
40+ }
41+
42+ expect ( title . trim ( ) ) . toEqual ( expectedTitle . trim ( ) ) ;
43+ expect ( location ) . toEqual ( expectedData . location . trim ( ) ) ;
44+ expect ( host ) . toEqual ( expectedData . host . trim ( ) ) ;
45+ expect ( repeats ) . toEqual (
46+ capitalizeFirstLetter ( expectedData . repeats ) . trim ( ) ,
47+ ) ;
4248 }
4349
4450 expect ( page . url ( ) ) . toEqual ( "https://core.aws.qa.acmuiuc.org/events/manage" ) ;
0 commit comments