Skip to content

Commit

Permalink
Merge pull request #1123 from flexion/962_update_validation_messages
Browse files Browse the repository at this point in the history
#962 Update Validation Messages
  • Loading branch information
wbyoko authored Mar 15, 2019
2 parents 40b8d76 + 10b0f69 commit 5de9fd7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions shared/src/business/entities/InitialWorkItemMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ joiValidationDecorator(
}),
undefined,
{
assigneeId: 'Recipient is a required field.',
message: 'Message is a required field.',
section: 'Section is a required field.',
assigneeId: 'Recipient is required.',
message: 'Message is required.',
section: 'Section is required.',
},
);

Expand Down
6 changes: 3 additions & 3 deletions shared/src/business/entities/InitialWorkItemMessage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ describe('InitialWorkItemMessage', () => {
it('should have error messages for missing fields', () => {
const message = new InitialWorkItemMessage({});
expect(message.getFormattedValidationErrors().message).toEqual(
'Message is a required field.',
'Message is required.',
);
expect(message.getFormattedValidationErrors().assigneeId).toEqual(
'Recipient is a required field.',
'Recipient is required.',
);
expect(message.getFormattedValidationErrors().section).toEqual(
'Section is a required field.',
'Section is required.',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ describe('validateInitialWorkItemMessage', () => {
});

expect(errors).toEqual({
assigneeId: 'Recipient is a required field.',
message: 'Message is a required field.',
section: 'Section is a required field.',
assigneeId: 'Recipient is required.',
message: 'Message is required.',
section: 'Section is required.',
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export default test => {
await test.runSequence('createWorkItemSequence');

expect(test.getState('validationErrors')).toEqual({
assigneeId: 'Recipient is a required field.',
message: 'Message is a required field.',
section: 'Section is a required field.',
assigneeId: 'Recipient is required.',
message: 'Message is required.',
section: 'Section is required.',
});

await test.runSequence('updateFormValueSequence', {
Expand Down

0 comments on commit 5de9fd7

Please sign in to comment.