Skip to content

Commit

Permalink
Fixes #33755 - Do not show errors on inline edit reopen (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
xprazak2 committed Nov 19, 2021
1 parent a53b008 commit 67bdcfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions webpack/components/EditableInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const EditableInput = props => {
const onCancel = () => {
setInputValue(props.value);
setEditing(false);
setError('');
};

const onChange = value => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ describe('OvalPoliciesShow', () => {
).not.toBeInTheDocument();
expect(screen.getByText(ovalPolicy.name)).toBeInTheDocument();
expect(screen.getByText('has already been taken')).toBeInTheDocument();
userEvent.click(
screen.getByRole('button', { name: 'cancel editing name' })
);
userEvent.click(editBtn);
expect(
screen.queryByText('has already been taken')
).not.toBeInTheDocument();
});
it('should not show edit btns when user is not allowed to edit', async () => {
render(
Expand Down

0 comments on commit 67bdcfe

Please sign in to comment.