diff --git a/packages/block-editor/src/components/link-control/test/index.js b/packages/block-editor/src/components/link-control/test/index.js index fa8c4d86eae5c9..4fb33ed5a17812 100644 --- a/packages/block-editor/src/components/link-control/test/index.js +++ b/packages/block-editor/src/components/link-control/test/index.js @@ -365,7 +365,7 @@ describe( 'Basic rendering', () => { /> ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); const isPreviewError = linkPreview.classList.contains( 'is-error' ); expect( isPreviewError ).toBe( true ); @@ -816,7 +816,7 @@ describe( 'Manual link entry', () => { render( ); - let linkPreview = screen.getByLabelText( 'Currently selected' ); + let linkPreview = screen.getByLabelText( 'Manage link' ); expect( linkPreview ).toBeInTheDocument(); @@ -850,7 +850,7 @@ describe( 'Manual link entry', () => { // Cancel the editing process. await user.click( cancelButton ); - linkPreview = screen.getByLabelText( 'Currently selected' ); + linkPreview = screen.getByLabelText( 'Manage link' ); expect( linkPreview ).toBeInTheDocument(); @@ -1058,7 +1058,7 @@ describe( 'Default search suggestions', () => { // Click the "Edit/Change" button and check initial suggestions are not // shown. - const currentLinkUI = screen.getByLabelText( 'Currently selected' ); + const currentLinkUI = screen.getByLabelText( 'Manage link' ); const currentLinkBtn = within( currentLinkUI ).getByRole( 'button', { name: 'Edit link', } ); @@ -1206,8 +1206,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => { // Check for loading indicator. const loadingIndicator = screen.getByText( 'Creating…' ); - const currentLinkLabel = - screen.queryByLabelText( 'Currently selected' ); + const currentLinkLabel = screen.queryByLabelText( 'Manage link' ); expect( currentLinkLabel ).not.toBeInTheDocument(); expect( loadingIndicator ).toBeVisible(); @@ -1218,8 +1217,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => { // Resolve the `createSuggestion` promise. resolver(); - const currentLink = - await screen.findByLabelText( 'Currently selected' ); + const currentLink = await screen.findByLabelText( 'Manage link' ); expect( currentLink ).toHaveTextContent( entityNameText ); expect( currentLink ).toHaveTextContent( '/?p=123' ); @@ -1265,7 +1263,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => { await user.click( createButton ); - const currentLink = screen.getByLabelText( 'Currently selected' ); + const currentLink = screen.getByLabelText( 'Manage link' ); expect( currentLink ).toHaveTextContent( 'Some new page to create' ); expect( currentLink ).toHaveTextContent( '/?p=123' ); @@ -1322,7 +1320,7 @@ describe( 'Creating Entities (eg: Posts, Pages)', () => { triggerEnter( searchInput ); expect( - await screen.findByLabelText( 'Currently selected' ) + await screen.findByLabelText( 'Manage link' ) ).toHaveTextContent( entityNameText ); } ); @@ -1495,7 +1493,7 @@ describe( 'Selecting links', () => { render( ); - const currentLink = screen.getByLabelText( 'Currently selected' ); + const currentLink = screen.getByLabelText( 'Manage link' ); const currentLinkAnchor = screen.getByRole( 'link', { name: `${ selectedLink.title } (opens in a new tab)`, } ); @@ -1525,7 +1523,7 @@ describe( 'Selecting links', () => { render( ); // Required in order to select the button below. - let currentLinkUI = screen.getByLabelText( 'Currently selected' ); + let currentLinkUI = screen.getByLabelText( 'Manage link' ); const currentLinkBtn = within( currentLinkUI ).getByRole( 'button', { name: 'Edit link', } ); @@ -1534,7 +1532,7 @@ describe( 'Selecting links', () => { await user.click( currentLinkBtn ); const searchInput = screen.getByRole( 'combobox', { name: 'Link' } ); - currentLinkUI = screen.queryByLabelText( 'Currently selected' ); + currentLinkUI = screen.queryByLabelText( 'Manage link' ); // We should be back to showing the search input. expect( searchInput ).toBeVisible(); @@ -1697,8 +1695,7 @@ describe( 'Selecting links', () => { triggerEnter( searchInput ); // Check that the suggestion selected via is now shown as selected. - const currentLink = - screen.getByLabelText( 'Currently selected' ); + const currentLink = screen.getByLabelText( 'Manage link' ); const currentLinkAnchor = screen.getByRole( 'link', { name: `${ selectedLink.title } (opens in a new tab)`, } ); @@ -2089,7 +2086,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); const isRichLinkPreview = linkPreview.classList.contains( 'is-rich' ); @@ -2110,7 +2107,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); await waitFor( () => expect( linkPreview ).toHaveClass( 'is-rich' ) ); } ); @@ -2127,7 +2124,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); await waitFor( () => expect( linkPreview ).toHaveClass( 'is-rich' ) ); @@ -2159,7 +2156,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); await waitFor( () => expect( linkPreview ).toHaveClass( 'is-rich' ) ); @@ -2183,7 +2180,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); await waitFor( () => expect( linkPreview ).toHaveClass( 'is-rich' ) ); @@ -2218,7 +2215,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); await waitFor( () => expect( linkPreview ).toHaveClass( 'is-rich' ) @@ -2243,7 +2240,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); expect( linkPreview ).toHaveClass( 'is-fetching' ); @@ -2262,7 +2259,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); expect( linkPreview ).toHaveClass( 'is-fetching' ); expect( linkPreview ).not.toHaveClass( 'is-rich' ); @@ -2275,7 +2272,7 @@ describe( 'Rich link previews', () => { render( ); - const linkPreview = screen.getByLabelText( 'Currently selected' ); + const linkPreview = screen.getByLabelText( 'Manage link' ); expect( linkPreview ).toHaveClass( 'is-fetching' );