@@ -128,8 +128,12 @@ test.describe('Bulk Edit', () => {
128128 'Updated 2 Posts successfully.' ,
129129 )
130130
131- await expect ( findTableCell ( page , '_status' , titleOfPostToPublish1 ) ) . toContainText ( 'Published' )
132- await expect ( findTableCell ( page , '_status' , titleOfPostToPublish2 ) ) . toContainText ( 'Published' )
131+ await expect ( await findTableCell ( page , '_status' , titleOfPostToPublish1 ) ) . toContainText (
132+ 'Published' ,
133+ )
134+ await expect ( await findTableCell ( page , '_status' , titleOfPostToPublish2 ) ) . toContainText (
135+ 'Published' ,
136+ )
133137 } )
134138
135139 test ( 'should unpublish many' , async ( ) => {
@@ -154,8 +158,12 @@ test.describe('Bulk Edit', () => {
154158 await page . locator ( '.list-selection__button[aria-label="Unpublish"]' ) . click ( )
155159 await page . locator ( '#unpublish-posts #confirm-action' ) . click ( )
156160
157- await expect ( findTableCell ( page , '_status' , titleOfPostToUnpublish1 ) ) . toContainText ( 'Draft' )
158- await expect ( findTableCell ( page , '_status' , titleOfPostToUnpublish2 ) ) . toContainText ( 'Draft' )
161+ await expect ( await findTableCell ( page , '_status' , titleOfPostToUnpublish1 ) ) . toContainText (
162+ 'Draft' ,
163+ )
164+ await expect ( await findTableCell ( page , '_status' , titleOfPostToUnpublish2 ) ) . toContainText (
165+ 'Draft' ,
166+ )
159167 } )
160168
161169 test ( 'should update many' , async ( ) => {
@@ -234,8 +242,12 @@ test.describe('Bulk Edit', () => {
234242 'Updated 2 Posts successfully.' ,
235243 )
236244
237- await expect ( findTableCell ( page , '_status' , titleOfPostToPublish1 ) ) . toContainText ( 'Published' )
238- await expect ( findTableCell ( page , '_status' , titleOfPostToPublish2 ) ) . toContainText ( 'Published' )
245+ await expect ( await findTableCell ( page , '_status' , titleOfPostToPublish1 ) ) . toContainText (
246+ 'Published' ,
247+ )
248+ await expect ( await findTableCell ( page , '_status' , titleOfPostToPublish2 ) ) . toContainText (
249+ 'Published' ,
250+ )
239251 } )
240252
241253 test ( 'should draft many from drawer' , async ( ) => {
@@ -272,8 +284,8 @@ test.describe('Bulk Edit', () => {
272284 'Updated 2 Posts successfully.' ,
273285 )
274286
275- await expect ( findTableCell ( page , '_status' , titleOfPostToDraft1 ) ) . toContainText ( 'Draft' )
276- await expect ( findTableCell ( page , '_status' , titleOfPostToDraft2 ) ) . toContainText ( 'Draft' )
287+ await expect ( await findTableCell ( page , '_status' , titleOfPostToDraft1 ) ) . toContainText ( 'Draft' )
288+ await expect ( await findTableCell ( page , '_status' , titleOfPostToDraft2 ) ) . toContainText ( 'Draft' )
277289 } )
278290
279291 test ( 'should delete all on page' , async ( ) => {
@@ -507,15 +519,12 @@ test.describe('Bulk Edit', () => {
507519 `Updated ${ postCount } Posts successfully.` ,
508520 )
509521
510- // eslint-disable-next-line jest-dom/prefer-checked
511- await expect ( page . locator ( 'input#select-all' ) ) . not . toHaveAttribute ( 'checked' , '' )
522+ await expect ( page . locator ( '.table input#select-all[checked]' ) ) . toBeHidden ( )
512523
513- for ( let i = 0 ; i < postCount ; i ++ ) {
514- // eslint-disable-next-line jest-dom/prefer-checked
515- await expect ( findTableCell ( page , '_select' , `Post ${ i + 1 } ` ) ) . not . toHaveAttribute (
516- 'checked' ,
517- '' ,
518- )
524+ for ( let i = 1 ; i < postCount + 1 ; i ++ ) {
525+ await expect (
526+ page . locator ( `table tbody tr .row-${ i } input[type="checkbox"][checked]` ) ,
527+ ) . toBeHidden ( )
519528 }
520529 } )
521530
@@ -537,20 +546,18 @@ test.describe('Bulk Edit', () => {
537546 `Updated ${ postCount } Posts successfully.` ,
538547 )
539548
540- // eslint-disable-next-line jest-dom/prefer-checked
541- await expect ( page . locator ( 'input#select-all' ) ) . not . toHaveAttribute ( 'checked' , '' )
549+ await expect ( page . locator ( '.table input#select-all[checked]' ) ) . toBeHidden ( )
542550
543- for ( let i = 0 ; i < postCount ; i ++ ) {
544- // eslint-disable-next-line jest-dom/prefer-checked
545- await expect ( findTableCell ( page , '_select' , `Post ${ i + 1 } ` ) ) . not . toHaveAttribute (
546- 'checked' ,
547- '' ,
548- )
551+ for ( let i = 1 ; i < postCount + 1 ; i ++ ) {
552+ await expect (
553+ page . locator ( `table tbody tr .row-${ i } input[type="checkbox"][checked]` ) ,
554+ ) . toBeHidden ( )
549555 }
550556 } )
551557
552558 test ( 'should toggle list selections off on successful edit' , async ( ) => {
553559 await deleteAllPosts ( )
560+ const bulkEditValue = 'test'
554561
555562 const postCount = 3
556563 Array . from ( { length : postCount } ) . forEach ( async ( _ , i ) => {
@@ -575,23 +582,20 @@ test.describe('Bulk Edit', () => {
575582 const titleOption = fieldSelect . locator ( '.rs__option:has-text("Title")' ) . first ( )
576583 await titleOption . click ( )
577584
578- await editDrawer . locator ( 'input#field-title' ) . fill ( 'test' )
585+ await editDrawer . locator ( 'input#field-title' ) . fill ( bulkEditValue )
579586
580587 await editDrawer . locator ( 'button[type="submit"]:has-text("Publish changes")' ) . click ( )
581588
582589 await expect ( page . locator ( '.payload-toast-container .toast-success' ) ) . toContainText (
583590 `Updated ${ postCount } Posts successfully.` ,
584591 )
585592
586- // eslint-disable-next-line jest-dom/prefer-checked
587- await expect ( page . locator ( 'input#select-all' ) ) . not . toHaveAttribute ( 'checked' , '' )
593+ await expect ( page . locator ( '.table input#select-all[checked]' ) ) . toBeHidden ( )
588594
589- for ( let i = 0 ; i < postCount ; i ++ ) {
590- // eslint-disable-next-line jest-dom/prefer-checked
591- await expect ( findTableCell ( page , '_select' , `Post ${ i + 1 } ` ) ) . not . toHaveAttribute (
592- 'checked' ,
593- '' ,
594- )
595+ for ( let i = 1 ; i < postCount + 1 ; i ++ ) {
596+ await expect (
597+ page . locator ( `table tbody tr .row-${ i } input[type="checkbox"][checked]` ) ,
598+ ) . toBeHidden ( )
595599 }
596600 } )
597601} )
0 commit comments