mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 23:58:07 +02:00
JS -- add function eMailValidate used to validate an email address
This commit is contained in:
parent
b194c820bf
commit
f94269c0d1
3 changed files with 29 additions and 1 deletions
|
@ -1202,5 +1202,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