mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 23:58:07 +02:00
Merge pull request #12719 from calixteman/emailvalidate
JS -- add function eMailValidate used to validate an email address
This commit is contained in:
commit
954ac3d944
3 changed files with 29 additions and 1 deletions
|
@ -1207,5 +1207,21 @@ describe("Scripting", function () {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("eMailValidate", function () {
|
||||
it("should validate an e-mail address", function (done) {
|
||||
Promise.all([
|
||||
myeval(`eMailValidate(123)`).then(value => {
|
||||
expect(value).toEqual(false);
|
||||
}),
|
||||
myeval(`eMailValidate("foo@bar.com")`).then(value => {
|
||||
expect(value).toEqual(true);
|
||||
}),
|
||||
myeval(`eMailValidate("foo bar")`).then(value => {
|
||||
expect(value).toEqual(false);
|
||||
}),
|
||||
]).then(() => done());
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue