@@ -30,13 +30,13 @@ describe("Contacts", () => {
3030
3131 await client . companies . attachContact ( {
3232 id : company . id ,
33- contact_id : contact . id ,
33+ contact_id : parseInt ( contact . id ! , 10 ) ,
3434 } ) ;
3535
3636 const subscriptionTypes = await client . subscriptionTypes . list ( ) ;
37- subscriptionId = subscriptionTypes . data [ 0 ] . id ;
37+ subscriptionId = subscriptionTypes . data ?. [ 0 ] ? .id ?? "0" ;
3838 await client . contacts . attachSubscription ( {
39- contact_id : contact . id ,
39+ contact_id : contact . id ! ,
4040 id : subscriptionId ,
4141 consent_type : "opt_in" ,
4242 } ) ;
@@ -45,7 +45,7 @@ describe("Contacts", () => {
4545 name : randomString ( ) ,
4646 } ) ;
4747 await client . tags . tagContact ( {
48- contact_id : contact . id ,
48+ contact_id : contact . id ! ,
4949 id : tag . id ,
5050 } ) ;
5151 } ) ;
@@ -54,15 +54,15 @@ describe("Contacts", () => {
5454 // cleanup
5555 try {
5656 await client . contacts . detachSubscription ( {
57- contact_id : contact . id ,
57+ contact_id : contact . id ! ,
5858 subscription_id : subscriptionId ,
5959 } ) ;
6060 } catch ( error ) {
6161 console . error ( "Failed to detach subscription:" , error ) ;
6262 }
63- await tryUntagContact ( client , contact . id , tag . id ) ;
64- await tryDeleteCompany ( client , company . id ) ;
65- await tryDeleteContact ( client , contact . id ) ;
63+ await tryUntagContact ( client , contact . id ! , tag . id ! ) ;
64+ await tryDeleteCompany ( client , company . id ! ) ;
65+ await tryDeleteContact ( client , contact . id ! ) ;
6666 } ) ;
6767
6868 it ( "list" , async ( ) => {
@@ -86,7 +86,7 @@ describe("Contacts", () => {
8686 expect ( response ) . toBeDefined ( ) ;
8787
8888 // cleanup
89- await tryDeleteContact ( client , response . id ) ;
89+ await tryDeleteContact ( client , response . id ! ) ;
9090 } ) ;
9191
9292 it ( "createLead" , async ( ) => {
@@ -100,13 +100,13 @@ describe("Contacts", () => {
100100 expect ( response ) . toBeDefined ( ) ;
101101
102102 // cleanup
103- await tryDeleteContact ( client , response . id ) ;
103+ await tryDeleteContact ( client , response . id ! ) ;
104104 } ) ;
105105
106106 it ( "find - by id" , async ( ) => {
107107 // act
108108 const response = await client . contacts . find ( {
109- contact_id : contact . id ,
109+ contact_id : contact . id ! ,
110110 } ) ;
111111
112112 // assert
@@ -119,15 +119,15 @@ describe("Contacts", () => {
119119
120120 // act
121121 const response = await client . contacts . update ( {
122- contact_id : contact . id ,
122+ contact_id : contact . id ! ,
123123 name : "Nico Bellic" ,
124124 } ) ;
125125
126126 // assert
127127 expect ( response ) . toBeDefined ( ) ;
128128
129129 // cleanup
130- await tryDeleteContact ( client , contact . id ) ;
130+ await tryDeleteContact ( client , contact . id ! ) ;
131131 } ) ;
132132
133133 it ( "archive" , async ( ) => {
@@ -136,14 +136,14 @@ describe("Contacts", () => {
136136
137137 // act
138138 const response = await client . contacts . archive ( {
139- contact_id : contact . id ,
139+ contact_id : contact . id ! ,
140140 } ) ;
141141
142142 // assert
143143 expect ( response ) . toBeDefined ( ) ;
144144
145145 // cleanup
146- await tryDeleteContact ( client , contact . id ) ;
146+ await tryDeleteContact ( client , contact . id ! ) ;
147147 } ) ;
148148
149149 it ( "unarchive" , async ( ) => {
@@ -152,14 +152,14 @@ describe("Contacts", () => {
152152
153153 // act
154154 const response = await client . contacts . unarchive ( {
155- contact_id : contact . id ,
155+ contact_id : contact . id ! ,
156156 } ) ;
157157
158158 // assert
159159 expect ( response ) . toBeDefined ( ) ;
160160
161161 // cleanup
162- await tryDeleteContact ( client , contact . id ) ;
162+ await tryDeleteContact ( client , contact . id ! ) ;
163163 } ) ;
164164
165165 it ( "delete" , async ( ) => {
@@ -171,7 +171,7 @@ describe("Contacts", () => {
171171
172172 // act
173173 const response = await client . contacts . delete ( {
174- contact_id : contact . id ,
174+ contact_id : contact . id ! ,
175175 } ) ;
176176
177177 // assert
@@ -189,22 +189,22 @@ describe("Contacts", () => {
189189 role : "lead" ,
190190 } ) ;
191191 const response = await client . contacts . mergeLeadInUser ( {
192- from : createdLead . id ,
193- into : createdUser . id ,
192+ from : createdLead . id ! ,
193+ into : createdUser . id ! ,
194194 } ) ;
195195
196196 // assert
197197 expect ( response ) . toBeDefined ( ) ;
198198
199199 // cleanup
200- await tryDeleteContact ( client , createdUser . id ) ;
201- await tryDeleteContact ( client , createdLead . id ) ;
200+ await tryDeleteContact ( client , createdUser . id ! ) ;
201+ await tryDeleteContact ( client , createdLead . id ! ) ;
202202 } ) ;
203203
204204 it ( "listAttachedCompanies" , async ( ) => {
205205 // act
206206 const response = await client . contacts . listAttachedCompanies ( {
207- contact_id : contact . id ,
207+ contact_id : contact . id ! ,
208208 } ) ;
209209
210210 // assert
@@ -214,7 +214,7 @@ describe("Contacts", () => {
214214 it ( "listAttachedEmailSubscriptions" , async ( ) => {
215215 // act
216216 const response = await client . contacts . listAttachedSubscriptions ( {
217- contact_id : contact . id ,
217+ contact_id : contact . id ! ,
218218 } ) ;
219219
220220 // assert
@@ -224,7 +224,7 @@ describe("Contacts", () => {
224224 it ( "listAttachedSegments" , async ( ) => {
225225 // act
226226 const response = await client . contacts . listAttachedSegments ( {
227- contact_id : contact . id ,
227+ contact_id : contact . id ! ,
228228 } ) ;
229229
230230 // assert
@@ -234,7 +234,7 @@ describe("Contacts", () => {
234234 it ( "listAttachedTags" , async ( ) => {
235235 // act
236236 const response = await client . contacts . listAttachedTags ( {
237- contact_id : contact . id ,
237+ contact_id : contact . id ! ,
238238 } ) ;
239239
240240 // assert
0 commit comments