Skip to content

Commit

Permalink
fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
usavkov-epam committed Dec 18, 2024
1 parent 69b1dad commit b6a98fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('SendClaimsModal', () => {
it('should render send claim modal', () => {
renderSendClaimsModal();

expect(screen.getByText('ui-receiving.modal.sendClaim.heading')).toBeInTheDocument();
expect(screen.getByText('stripes-acq-components.claiming.modal.sendClaim.heading')).toBeInTheDocument();
});

it('should validate "Claim expiry date" field', async () => {
Expand All @@ -45,7 +45,7 @@ describe('SendClaimsModal', () => {

await user.type(screen.getByPlaceholderText(FORMAT), today.format(FORMAT));
await user.click(saveBtn);
expect(screen.getByText('ui-receiving.validation.dateAfter')).toBeInTheDocument();
expect(screen.getByText('stripes-acq-components.validation.dateAfter')).toBeInTheDocument();
});

it('should submit valid form', async () => {
Expand All @@ -56,8 +56,8 @@ describe('SendClaimsModal', () => {
const externalNote = 'External';

await user.type(screen.getByPlaceholderText(FORMAT), date.format(FORMAT));
await user.type(screen.getByLabelText('ui-receiving.piece.internalNote'), internalNote);
await user.type(screen.getByLabelText('ui-receiving.piece.externalNote'), externalNote);
await user.type(screen.getByLabelText('stripes-acq-components.claiming.modal.sendClaim.field.internalNote'), internalNote);
await user.type(screen.getByLabelText('stripes-acq-components.claiming.modal.sendClaim.field.externalNote'), externalNote);
await user.click(screen.getByRole('button', { name: 'stripes-acq-components.FormFooter.save' }));

expect(defaultProps.onSubmit).toHaveBeenCalledWith(
Expand Down
1 change: 1 addition & 0 deletions translations/stripes-acq-components/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
"location.label": "Name (code)",

"validation.cantContainSpaces": "Spaces aren't allowed",
"validation.dateAfter": "Selected date must be later than the current date",
"validation.fundDistributionType": "All distributions should be the same type",
"validation.fundDistribution.uniqueFunds": "You can not have multiple distributions for the same fund with the same expense class.",
"validation.invalidURL": "URL is not valid, must include URL scheme. Eg. ftp://",
Expand Down

0 comments on commit b6a98fe

Please sign in to comment.