Skip to content

Commit

Permalink
fix(PN-9835): clear file name when remove a document on new notificat…
Browse files Browse the repository at this point in the history
…ion attachments (#1183)
  • Loading branch information
alessandrogelmi authored Apr 15, 2024
1 parent a78d784 commit 32d7b6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ const Attachments: React.FC<Props> = ({
key: '',
versionToken: '',
},
name: '',
});

await formik.setFieldTouched(`${id}.name`, false, false);
};

const addDocumentHandler = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,8 @@ describe('Attachments Component with payment enabled', async () => {
expect(buttonSubmit).toBeDisabled();
});
await testInput(form!, `documents.0.name`, '');
const error = form!.querySelector(`[id="documents.0.name-helper-text"]`);
expect(error).toHaveTextContent('required-field');
await testInput(form!, `documents.0.name`, ' text-with-spaces ');
const error = form!.querySelector(`[id="documents.0.name-helper-text"]`);
expect(error).toHaveTextContent('no-spaces-at-edges');
});

Expand Down

0 comments on commit 32d7b6e

Please sign in to comment.