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 32db57a55d76ed..b8b7e1afa2d805 100644 --- a/packages/block-editor/src/components/link-control/test/index.js +++ b/packages/block-editor/src/components/link-control/test/index.js @@ -1816,66 +1816,6 @@ describe( 'Selecting links', () => { } ); describe( 'Addition Settings UI', () => { - it( 'should allow toggling the "Opens in new tab" setting control (only) on the link preview', async () => { - const user = userEvent.setup(); - const selectedLink = fauxEntitySuggestions[ 0 ]; - const mockOnChange = jest.fn(); - - const customSettings = [ - { - id: 'opensInNewTab', - title: 'Open in new tab', - }, - { - id: 'noFollow', - title: 'No follow', - }, - ]; - - const LinkControlConsumer = () => { - const [ link, setLink ] = useState( selectedLink ); - - return ( - { - mockOnChange( newVal ); - setLink( newVal ); - } } - /> - ); - }; - - render( ); - - const opensInNewTabField = screen.queryByRole( 'checkbox', { - name: 'Open in new tab', - checked: false, - } ); - - expect( opensInNewTabField ).toBeInTheDocument(); - - // No matter which settings are passed in only the `Opens in new tab` - // setting should be shown on the link preview (non-editing) state. - const noFollowField = screen.queryByRole( 'checkbox', { - name: 'No follow', - } ); - expect( noFollowField ).not.toBeInTheDocument(); - - // Check that the link value is updated immediately upon checking - // the checkbox. - await user.click( opensInNewTabField ); - - expect( opensInNewTabField ).toBeChecked(); - - expect( mockOnChange ).toHaveBeenCalledTimes( 1 ); - expect( mockOnChange ).toHaveBeenCalledWith( { - ...selectedLink, - opensInNewTab: true, - } ); - } ); - it( 'should hide advanced link settings and toggle when not editing a link', async () => { const selectedLink = fauxEntitySuggestions[ 0 ];