Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PN-9835 - Clear name of attachment on remove document #1183

Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading