Skip to content

Commit 2da82c9

Browse files
committed
Administration: Fix e2e tests after removing aria-label.
Follow-up to [61738]. Updates e2e tests to use new link name. Applies change to omitted case in term list tables. Props joedolson. Fixes #33002. git-svn-id: https://develop.svn.wordpress.org/trunk@61740 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 121d67d commit 2da82c9

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/wp-admin/includes/class-wp-terms-list-table.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,8 @@ public function column_name( $tag ) {
413413
$edit_link
414414
);
415415
$name = sprintf(
416-
'<a class="row-title" href="%s" aria-label="%s">%s</a>',
416+
'<a class="row-title" href="%s">%s</a>',
417417
esc_url( $edit_link ),
418-
/* translators: %s: Taxonomy term name. */
419-
esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $tag->name ) ),
420418
$name
421419
);
422420
}

tests/e2e/specs/edit-posts.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ test.describe( 'Edit Posts', () => {
5353
await expect( listTable ).toBeVisible();
5454

5555
// Click the post title (edit) link
56-
await listTable.getByRole( 'link', { name: `“${ title }” (Edit)` } ).click();
56+
await listTable.getByRole( 'link', { name: title, exact: true } ).click();
5757

5858
// Wait for the editor iframe to load, and switch to it as the active content frame.
5959
await page
@@ -84,7 +84,7 @@ test.describe( 'Edit Posts', () => {
8484
await expect( listTable ).toBeVisible();
8585

8686
// // Focus on the post title link.
87-
await listTable.getByRole( 'link', { name: `“${ title }” (Edit)` } ).focus();
87+
await listTable.getByRole( 'link', { name: title, exact: true } ).focus();
8888

8989
// Tab to the Quick Edit button and press Enter to quick edit.
9090
await pageUtils.pressKeys( 'Tab', { times: 2 } )
@@ -122,7 +122,7 @@ test.describe( 'Edit Posts', () => {
122122
await expect( listTable ).toBeVisible();
123123

124124
// Focus on the post title link.
125-
await listTable.getByRole( 'link', { name: `“${ title }” (Edit)` } ).focus();
125+
await listTable.getByRole( 'link', { name: title, exact: true } ).focus();
126126

127127
// Tab to the Trash button and press Enter to delete the post.
128128
await pageUtils.pressKeys( 'Tab', { times: 3 } )

tests/e2e/specs/empty-trash-restore-trashed-posts.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test.describe( 'Empty Trash', () => {
2020
await expect( listTable ).toBeVisible();
2121

2222
// Move post to trash
23-
await listTable.getByRole( 'link', { name: `“${ POST_TITLE }” (Edit)` } ).hover();
23+
await listTable.getByRole( 'link', { name: POST_TITLE, exact: true } ).hover();
2424
await listTable.getByRole( 'link', { name: `Move “${POST_TITLE}” to the Trash` } ).click();
2525

2626
// Empty trash
@@ -40,7 +40,7 @@ test.describe( 'Empty Trash', () => {
4040
await expect( listTable ).toBeVisible();
4141

4242
// Move post to trash
43-
await listTable.getByRole( 'link', { name: `“${ POST_TITLE }” (Edit)` } ).hover();
43+
await listTable.getByRole( 'link', { name: POST_TITLE, exact: true } ).hover();
4444
await listTable.getByRole( 'link', { name: `Move “${POST_TITLE}” to the Trash` } ).click();
4545

4646
await page.getByRole( 'link', { name: 'Trash' } ).click();

0 commit comments

Comments
 (0)