88} from '@seamapi/http/connect'
99
1010test ( 'waitForActionAttempt: waits for pending action attempt' , async ( t ) => {
11- const { seed, endpoint, db } = await getTestServer ( t )
11+ const { seed, endpoint } = await getTestServer ( t )
1212
1313 const seam = SeamHttp . fromApiKey ( seed . seam_apikey1_token , {
1414 endpoint,
@@ -21,13 +21,13 @@ test('waitForActionAttempt: waits for pending action attempt', async (t) => {
2121
2222 t . is ( actionAttempt . status , 'pending' )
2323
24- db . updateActionAttempt ( {
24+ await seam . client . post ( '/_fake/update_action_attempt' , {
2525 action_attempt_id : actionAttempt . action_attempt_id ,
2626 status : 'pending' ,
2727 } )
2828
2929 setTimeout ( ( ) => {
30- db . updateActionAttempt ( {
30+ void seam . client . post ( '/_fake/update_action_attempt' , {
3131 action_attempt_id : actionAttempt . action_attempt_id ,
3232 status : 'success' ,
3333 } )
@@ -45,7 +45,7 @@ test('waitForActionAttempt: waits for pending action attempt', async (t) => {
4545} )
4646
4747test ( 'waitForActionAttempt: returns successful action attempt' , async ( t ) => {
48- const { seed, endpoint, db } = await getTestServer ( t )
48+ const { seed, endpoint } = await getTestServer ( t )
4949
5050 const seam = SeamHttp . fromApiKey ( seed . seam_apikey1_token , {
5151 endpoint,
@@ -58,7 +58,7 @@ test('waitForActionAttempt: returns successful action attempt', async (t) => {
5858
5959 t . is ( actionAttempt . status , 'pending' )
6060
61- db . updateActionAttempt ( {
61+ await seam . client . post ( '/_fake/update_action_attempt' , {
6262 action_attempt_id : actionAttempt . action_attempt_id ,
6363 status : 'success' ,
6464 } )
@@ -85,7 +85,7 @@ test('waitForActionAttempt: returns successful action attempt', async (t) => {
8585} )
8686
8787test ( 'waitForActionAttempt: times out while waiting for action attempt' , async ( t ) => {
88- const { seed, endpoint, db } = await getTestServer ( t )
88+ const { seed, endpoint } = await getTestServer ( t )
8989
9090 const seam = SeamHttp . fromApiKey ( seed . seam_apikey1_token , {
9191 endpoint,
@@ -98,7 +98,7 @@ test('waitForActionAttempt: times out while waiting for action attempt', async (
9898
9999 t . is ( actionAttempt . status , 'pending' )
100100
101- db . updateActionAttempt ( {
101+ await seam . client . post ( '/_fake/update_action_attempt' , {
102102 action_attempt_id : actionAttempt . action_attempt_id ,
103103 status : 'pending' ,
104104 } )
@@ -122,7 +122,7 @@ test('waitForActionAttempt: times out while waiting for action attempt', async (
122122} )
123123
124124test ( 'waitForActionAttempt: rejects when action attempt fails' , async ( t ) => {
125- const { seed, endpoint, db } = await getTestServer ( t )
125+ const { seed, endpoint } = await getTestServer ( t )
126126
127127 const seam = SeamHttp . fromApiKey ( seed . seam_apikey1_token , {
128128 endpoint,
@@ -135,7 +135,7 @@ test('waitForActionAttempt: rejects when action attempt fails', async (t) => {
135135
136136 t . deepEqual ( actionAttempt . status , 'pending' )
137137
138- db . updateActionAttempt ( {
138+ await seam . client . post ( '/_fake/update_action_attempt' , {
139139 action_attempt_id : actionAttempt . action_attempt_id ,
140140 status : 'error' ,
141141 error : {
@@ -163,7 +163,7 @@ test('waitForActionAttempt: rejects when action attempt fails', async (t) => {
163163} )
164164
165165test ( 'waitForActionAttempt: times out if waiting for polling interval' , async ( t ) => {
166- const { seed, endpoint, db } = await getTestServer ( t )
166+ const { seed, endpoint } = await getTestServer ( t )
167167
168168 const seam = SeamHttp . fromApiKey ( seed . seam_apikey1_token , {
169169 endpoint,
@@ -176,7 +176,7 @@ test('waitForActionAttempt: times out if waiting for polling interval', async (t
176176
177177 t . is ( actionAttempt . status , 'pending' )
178178
179- db . updateActionAttempt ( {
179+ await seam . client . post ( '/_fake/update_action_attempt' , {
180180 action_attempt_id : actionAttempt . action_attempt_id ,
181181 status : 'pending' ,
182182 } )
0 commit comments