Skip to content

Commit 763d9c2

Browse files
committed
Create client session with api key
1 parent 04e5473 commit 763d9c2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/seam/connect/client-session-token.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,21 @@ test('SeamHttp: updateClientSessionToken returns instance authorized with a new
5656
const seam = SeamHttp.fromClientSessionToken(seed.seam_cst1_token, {
5757
endpoint,
5858
})
59-
const { token } = await seam.clientSessions.create({
59+
60+
const devices = await seam.devices.list()
61+
t.true(devices.length > 0)
62+
63+
const seamUsingApiKey = SeamHttp.fromApiKey(seed.seam_apikey2_token, {
64+
endpoint,
65+
})
66+
67+
const { token } = await seamUsingApiKey.clientSessions.create({
6068
user_identifier_key: 'some-new-user-identifier-key',
6169
})
6270

6371
await seam.updateClientSessionToken(token)
64-
const devices = await seam.devices.list()
65-
t.is(devices.length, 0)
72+
const devicesFromNewSession = await seam.devices.list()
73+
t.is(devicesFromNewSession.length, 0)
6674
})
6775

6876
test('SeamHttp: updateClientSessionToken fails if no existing clientSessionToken', async (t) => {

0 commit comments

Comments
 (0)