11
22
33import { createAddress , createFullName , createPhone } from "../helpers"
4- import { Agent , BusinessApplication , CancelApplicationRequest , CreateBusinessApplicationRequest , CreateIndividualApplicationRequest , CreateSoleProprietorApplicationRequest , CreateTrustApplicationRequest , IndividualApplication , PatchApplicationRequest , PatchBusinessApplicationAttributes , PatchBusinessApplicationBeneficialOwner , RelationshipsArrayData , TrustApplication , Unit } from "../unit"
4+ import { Agent , BusinessApplication , CancelApplicationRequest , CreateBusinessApplicationRequest , CreateIndividualApplicationRequest , CreateSoleProprietorApplicationRequest , IndividualApplication , PatchApplicationRequest , PatchBusinessApplicationAttributes , PatchBusinessApplicationBeneficialOwner , RelationshipsArrayData , Unit } from "../unit"
55import {
66 createIndividualApplication ,
77 createBusinessApplication ,
8- createTrustApplication ,
98 createIndividualApplicationWithRequiredDocument
109} from "./testHelpers"
1110import dotenv from "dotenv"
@@ -69,12 +68,6 @@ describe("Create Application", () => {
6968 const res = await unit . applications . get ( createRes . data . id )
7069 expect ( res . data . type ) . toBe ( "businessApplication" )
7170 } )
72-
73- test ( "Create Trust Application" , async ( ) => {
74- const createRes = await createTrustApplication ( unit )
75- const res = await unit . applications . get ( createRes . data . id )
76- expect ( res . data . type ) . toBe ( "trustApplication" )
77- } )
7871} )
7972
8073describe ( "Applications" , ( ) => {
@@ -108,7 +101,7 @@ describe("Applications", () => {
108101 } ,
109102110103 }
111-
104+
112105 const app : IndividualApplication = {
113106 "type" : "individualApplication" ,
114107 "id" : "53" ,
@@ -637,227 +630,6 @@ describe("Business Applications", () => {
637630
638631 expect ( updated_application . data . type ) . toBe ( "businessApplication" )
639632 } )
640- } )
641-
642-
643- describe ( "TrustApplications" , ( ) => {
644- test ( "Simulate trustApplication response from API" , async ( ) => {
645- const app : TrustApplication = {
646- "type" : "trustApplication" ,
647- "id" : "51" ,
648- "attributes" : {
649- "createdAt" : "2022-04-02T21:59:46.324Z" ,
650- "name" : "Trust me Inc." ,
651- "contact" : {
652- "fullName" : {
653- "first" : "Jared" ,
654- "last" : "Dunn"
655- } ,
656- 657- "phone" : {
658- "countryCode" : "1" ,
659- "number" : "2025550108"
660- } ,
661- "address" : {
662- "street" : "5230 Newell Rd" ,
663- "city" : "Palo Alto" ,
664- "state" : "CA" ,
665- "postalCode" : "94303" ,
666- "country" : "US"
667- }
668- } ,
669- "status" : "AwaitingDocuments" ,
670- "message" : "Waiting for you to upload the required documents." ,
671- "stateOfIncorporation" : "CA" ,
672- "revocability" : "Revocable" ,
673- "sourceOfFunds" : "Salary" ,
674- "taxId" : "123456789" ,
675- "grantor" : {
676- "status" : "PendingReview" ,
677- "fullName" : {
678- "first" : "Laurie" ,
679- "last" : "Bream"
680- } ,
681- "ssn" : "000000003" ,
682- "address" : {
683- "street" : "950 Allerton Street" ,
684- "city" : "Redwood City" ,
685- "state" : "CA" ,
686- "postalCode" : "94063" ,
687- "country" : "US"
688- } ,
689- "dateOfBirth" : "2000-01-01" ,
690- 691- "phone" : {
692- "countryCode" : "1" ,
693- "number" : "2025550108"
694- }
695- } ,
696- "tags" : {
697- "test" : "test1"
698- } ,
699- "archived" : false
700- } ,
701- "relationships" : {
702- "org" : {
703- "data" : {
704- "type" : "org" ,
705- "id" : "1"
706- }
707- } ,
708- "trustees" : {
709- "data" : [
710- {
711- "type" : "trustee" ,
712- "id" : "21"
713- }
714- ]
715- } ,
716- "beneficiaries" : {
717- "data" : [
718- {
719- "type" : "beneficiary" ,
720- "id" : "33"
721- } ,
722- {
723- "type" : "beneficiary" ,
724- "id" : "34"
725- }
726- ]
727- } ,
728- "documents" : {
729- "data" : [
730- {
731- "type" : "document" ,
732- "id" : "201"
733- } ,
734- {
735- "type" : "document" ,
736- "id" : "202"
737- } ,
738- {
739- "type" : "document" ,
740- "id" : "203"
741- }
742- ]
743- }
744- }
745- }
746-
747- expect ( app . type ) . toBe ( "trustApplication" )
748- expect ( app . attributes . grantor . address . street ) . toBe ( "950 Allerton Street" )
749- } )
750-
751- test ( "Simulation CreateTrustApplicationRequest - test structure" , ( ) => {
752- const req : CreateTrustApplicationRequest = {
753- "type" : "trustApplication" ,
754- "attributes" : {
755- "name" : "Trust me Inc." ,
756- "stateOfIncorporation" : "CA" ,
757- "revocability" : "Revocable" ,
758- "sourceOfFunds" : "Salary" ,
759- "taxId" : "123456789" ,
760- "trustees" : [
761- {
762- "fullName" : {
763- "first" : "Richard" ,
764- "last" : "Hendricks"
765- } ,
766- "dateOfBirth" : "2000-01-01" ,
767- "ssn" : "000000002" ,
768- 769- "phone" : {
770- "countryCode" : "1" ,
771- "number" : "2025550108"
772- } ,
773- "address" : {
774- "street" : "5230 Newell Rd" ,
775- "city" : "Palo Alto" ,
776- "state" : "CA" ,
777- "postalCode" : "94303" ,
778- "country" : "US"
779- }
780- }
781- ] ,
782- "contact" : {
783- "fullName" : {
784- "first" : "Jared" ,
785- "last" : "Dunn"
786- } ,
787- 788- "phone" : {
789- "countryCode" : "1" ,
790- "number" : "2025550108"
791- } ,
792- "address" : {
793- "street" : "5230 Newell Rd" ,
794- "city" : "Palo Alto" ,
795- "state" : "CA" ,
796- "postalCode" : "94303" ,
797- "country" : "US"
798- }
799- } ,
800- "grantor" : {
801- "fullName" : {
802- "first" : "Laurie" ,
803- "last" : "Bream"
804- } ,
805- "dateOfBirth" : "2000-01-01" ,
806- "ssn" : "000000003" ,
807- 808- "phone" : {
809- "countryCode" : "1" ,
810- "number" : "2025550108"
811- } ,
812- "address" : {
813- "street" : "950 Allerton Street" ,
814- "city" : "Redwood City" ,
815- "state" : "CA" ,
816- "postalCode" : "94063" ,
817- "country" : "US"
818- }
819- } ,
820- "tags" : {
821- "test" : "test1"
822- } ,
823- "beneficiaries" : [
824- {
825- "fullName" : {
826- "first" : "Dinesh" ,
827- "last" : "Chugtai"
828- } ,
829- "dateOfBirth" : "2000-01-01"
830- } ,
831- {
832- "fullName" : {
833- "first" : "Gilfoyle" ,
834- "last" : "Unknown"
835- } ,
836- "dateOfBirth" : "2000-01-01"
837- }
838- ]
839- }
840- }
841-
842- expect ( req . type ) . toBe ( "trustApplication" )
843- } )
844-
845- test ( "Simulation UpdateTrustApplicationRequest - test structure" , ( ) => {
846- const req : PatchApplicationRequest = {
847- applicationId : "123" ,
848- data : {
849- "type" : "trustApplication" ,
850- "attributes" : {
851- "tags" : {
852- "by" : "Richard Hendricks" ,
853- "id" : "23033b64-38f8-4dbc-91a1-313ff0156d02"
854- }
855- }
856- }
857- }
858-
859- expect ( req . data . type ) . toBe ( "trustApplication" )
860- } )
861633} )
862634
863635describe ( "Applications" , ( ) => {
@@ -933,7 +705,7 @@ describe("Create and Close Application", () => {
933705 occupation : "Doctor"
934706 }
935707 }
936-
708+
937709 const createReq = await unit . applications . create ( createIndividualApplication )
938710 expect ( createReq . data . type ) . toBe ( "individualApplication" )
939711 const closeRequest : CancelApplicationRequest = {
@@ -943,7 +715,7 @@ describe("Create and Close Application", () => {
943715 attributes : {
944716 reason : "By Org"
945717 }
946- }
718+ }
947719 }
948720
949721 const closeRes = await unit . applications . cancel ( closeRequest )
0 commit comments