Skip to content

Commit

Permalink
Merge branch 'master' into feat/civ-12317
Browse files Browse the repository at this point in the history
  • Loading branch information
vasudevganesanhmcts authored Oct 15, 2024
2 parents 526853e + b20684e commit 5e1da3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/common/form/validators/emailValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import validator from 'validator';
export class EmailValidator implements ValidatorConstraintInterface {
//eslint-disable-next-line
readonly EMAIL_REGEX = /^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/;
readonly EMAIL_MAX_LENGTH = 40;
readonly EMAIL_MAX_LENGTH = 320;

validate(value: string) {
const emailPattern = this.EMAIL_REGEX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ describe('Completing Claim', () => {

it('should return error on input too long', async () => {
app.locals.draftStoreClient = mockCivilClaim;
const greaterThan320CharsEmail = 'x'.repeat(311) + '@gmail.com';
await request(app)
.post(CLAIM_DEFENDANT_EMAIL_URL)
.send({emailAddress: '[email protected]'})
.send({emailAddress: greaterThan320CharsEmail})
.expect((res) => {
expect(res.status).toBe(200);
expect(res.text).toContain(TestMessages.ENTER_VALID_EMAIL);
Expand Down

0 comments on commit 5e1da3b

Please sign in to comment.