Skip to content

Commit 59e5e65

Browse files
Update REGEX for mail and phone validation
1 parent 3b9203b commit 59e5e65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/unit/models/profileDiffs.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("profileDiffs", function () {
2121
const profileDiffId = await profileDiffsQuery.add(profileDiffs[0]);
2222
const diff = await profileDiffsQuery.fetchProfileDiffUnobfuscated(profileDiffId);
2323
expect(diff.phone).to.match(/^(\+\d{1,3}[- ]?)?\d{7,10}$/);
24-
expect(diff.email).to.match(/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i);
24+
expect(diff.email).to.match(/^([A-Z0-9+-]{1,20}(.[A-Z0-9+-]{1,20})*)@[A-Z0-9][A-Z0-9-](.[A-Z]{2,})+$/i);
2525
});
2626
});
2727
});

0 commit comments

Comments
 (0)