Skip to content

Commit

Permalink
Remove unnecessary test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave authored and scruffian committed Aug 2, 2023
1 parent 875f43a commit 80f8342
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 @@ -2367,48 +2367,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 80f8342

Please sign in to comment.