-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(core): add disposable phone validation (#3598)
- Loading branch information
Showing
4 changed files
with
74 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
core/api/test/unit/services/twilio/is-disposable-phone-number.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { isDisposablePhoneNumber } from "@/services/twilio-service" | ||
|
||
describe("Twilio Service", () => { | ||
describe("isDisposablePhoneNumber", () => { | ||
const amounts = [ | ||
{ phone: "+34689682259", expected: true }, | ||
{ phone: "34689682259", expected: true }, | ||
{ phone: "+34699682259", expected: false }, | ||
{ phone: "34699682259", expected: false }, | ||
] | ||
test.each(amounts)("phone $phone is disposable: $expected", ({ phone, expected }) => { | ||
const result = isDisposablePhoneNumber(phone as PhoneNumber) | ||
expect(result).toEqual(expected) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.