@@ -128,8 +128,12 @@ test.describe('Bulk Edit', () => {
128
128
'Updated 2 Posts successfully.' ,
129
129
)
130
130
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
+ )
133
137
} )
134
138
135
139
test ( 'should unpublish many' , async ( ) => {
@@ -154,8 +158,12 @@ test.describe('Bulk Edit', () => {
154
158
await page . locator ( '.list-selection__button[aria-label="Unpublish"]' ) . click ( )
155
159
await page . locator ( '#unpublish-posts #confirm-action' ) . click ( )
156
160
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
+ )
159
167
} )
160
168
161
169
test ( 'should update many' , async ( ) => {
@@ -234,8 +242,12 @@ test.describe('Bulk Edit', () => {
234
242
'Updated 2 Posts successfully.' ,
235
243
)
236
244
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
+ )
239
251
} )
240
252
241
253
test ( 'should draft many from drawer' , async ( ) => {
@@ -272,8 +284,8 @@ test.describe('Bulk Edit', () => {
272
284
'Updated 2 Posts successfully.' ,
273
285
)
274
286
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' )
277
289
} )
278
290
279
291
test ( 'should delete all on page' , async ( ) => {
@@ -507,15 +519,12 @@ test.describe('Bulk Edit', () => {
507
519
`Updated ${ postCount } Posts successfully.` ,
508
520
)
509
521
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 ( )
512
523
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 ( )
519
528
}
520
529
} )
521
530
@@ -537,20 +546,18 @@ test.describe('Bulk Edit', () => {
537
546
`Updated ${ postCount } Posts successfully.` ,
538
547
)
539
548
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 ( )
542
550
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 ( )
549
555
}
550
556
} )
551
557
552
558
test ( 'should toggle list selections off on successful edit' , async ( ) => {
553
559
await deleteAllPosts ( )
560
+ const bulkEditValue = 'test'
554
561
555
562
const postCount = 3
556
563
Array . from ( { length : postCount } ) . forEach ( async ( _ , i ) => {
@@ -575,23 +582,20 @@ test.describe('Bulk Edit', () => {
575
582
const titleOption = fieldSelect . locator ( '.rs__option:has-text("Title")' ) . first ( )
576
583
await titleOption . click ( )
577
584
578
- await editDrawer . locator ( 'input#field-title' ) . fill ( 'test' )
585
+ await editDrawer . locator ( 'input#field-title' ) . fill ( bulkEditValue )
579
586
580
587
await editDrawer . locator ( 'button[type="submit"]:has-text("Publish changes")' ) . click ( )
581
588
582
589
await expect ( page . locator ( '.payload-toast-container .toast-success' ) ) . toContainText (
583
590
`Updated ${ postCount } Posts successfully.` ,
584
591
)
585
592
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 ( )
588
594
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 ( )
595
599
}
596
600
} )
597
601
} )
0 commit comments