Skip to content

Commit

Permalink
Remove unnecessary test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Jul 27, 2023
1 parent 85a3075 commit eb6c27a
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions packages/block-editor/src/components/link-control/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2366,48 +2366,6 @@ describe( 'Controlling link title text', () => {
screen.queryByRole( 'textbox', { name: 'Text' } )
).not.toBeInTheDocument();
} );

it( 'should reset state upon controlled value change', async () => {
const user = userEvent.setup();
const textValue = 'My new text value';
const mockOnChange = jest.fn();

const { rerender } = render(
<LinkControl
value={ selectedLink }
forceIsEditingLink
hasTextControl
onChange={ mockOnChange }
/>
);

await toggleSettingsDrawer( user );

const textInput = screen.queryByRole( 'textbox', { name: 'Text' } );

expect( textInput ).toBeVisible();

await user.clear( textInput );
await user.keyboard( textValue );

// Was originally title: 'Hello Page', but we've changed it.
rerender(
<LinkControl
value={ {
...selectedLink,
title: 'Something else',
} }
forceIsEditingLink
hasTextControl
onChange={ mockOnChange }
/>
);

// The text input should not be showing as the form is submitted.
expect( screen.queryByRole( 'textbox', { name: 'Text' } ) ).toHaveValue(
'Something else'
);
} );
} );

function getSettingsDrawerToggle() {
Expand Down

0 comments on commit eb6c27a

Please sign in to comment.