Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unnecessary test coverage
  • Loading branch information
getdave committed Oct 5, 2023
commit 263d848e2416b620577de16667e857f645a0e911
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 @@ -2509,48 +2509,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