File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ import test from 'ava'
2
+ import { getTestServer } from 'fixtures/seam/connect/api.js'
3
+
4
+ import { SeamHttp } from '@seamapi/http/connect'
5
+
6
+ test ( 'SeamHttp: fromClient returns instance that uses client' , async ( t ) => {
7
+ const { seed, endpoint } = await getTestServer ( t )
8
+ const client = SeamHttp . fromClient (
9
+ SeamHttp . fromApiKey ( seed . seam_apikey1_token , { endpoint } ) . client ,
10
+ )
11
+ const device = await client . devices . get ( {
12
+ device_id : seed . august_device_1 ,
13
+ } )
14
+ t . is ( device . workspace_id , seed . seed_workspace_1 )
15
+ t . is ( device . device_id , seed . august_device_1 )
16
+ } )
17
+
18
+ test ( 'SeamHttp: constructor returns instance that uses client' , async ( t ) => {
19
+ const { seed, endpoint } = await getTestServer ( t )
20
+ const client = new SeamHttp ( {
21
+ client : SeamHttp . fromApiKey ( seed . seam_apikey1_token , { endpoint } ) . client ,
22
+ } )
23
+ const device = await client . devices . get ( {
24
+ device_id : seed . august_device_1 ,
25
+ } )
26
+ t . is ( device . workspace_id , seed . seed_workspace_1 )
27
+ t . is ( device . device_id , seed . august_device_1 )
28
+ } )
You can’t perform that action at this time.
0 commit comments