ekyc

Electronic KYC process with uploading ID document using OAuth 2.1 (experimental)
Log | Files | Refs | README | LICENSE

personal_phone_number.test.ts (979B)


      1 import {
      2   InvalidPersonalPhoneNumber,
      3   PersonalPhoneNumber,
      4 } from "#core/domain/personal_phone_number.ts";
      5 import { assertThrows } from "$std/assert/assert_throws.ts";
      6 import { ValitaError } from "$valita";
      7 
      8 Deno.test({
      9   name: "unit personal phone number. shared cost case",
     10   fn() {
     11     const act = () => new PersonalPhoneNumber("08407263232");
     12     assertThrows(act, InvalidPersonalPhoneNumber);
     13   },
     14 });
     15 
     16 Deno.test({
     17   name: "unit personal phone number. shared cost case",
     18   fn() {
     19     const act = () => new PersonalPhoneNumber("00338427262332");
     20     assertThrows(act, InvalidPersonalPhoneNumber);
     21   },
     22 });
     23 
     24 Deno.test({
     25   name: "unit personal phone number. shared cost case",
     26   fn() {
     27     const act = () => new PersonalPhoneNumber("+338427262332");
     28     assertThrows(act, InvalidPersonalPhoneNumber);
     29   },
     30 });
     31 
     32 Deno.test({
     33   name: "unit personal phone number. normal phone number",
     34   fn() {
     35     const act = () => new PersonalPhoneNumber("+41789444444");
     36     act();
     37   },
     38 });