Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"axios-retry": "^4.4.2"
},
"devDependencies": {
"@seamapi/fake-seam-connect": "1.71.0",
"@seamapi/fake-seam-connect": "1.74.0",
"@seamapi/types": "1.302.2",
"@types/eslint": "^8.44.2",
"@types/node": "^20.8.10",
Expand Down
18 changes: 13 additions & 5 deletions test/seam/connect/client-session-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,21 @@ test('SeamHttp: updateClientSessionToken returns instance authorized with a new
const seam = SeamHttp.fromClientSessionToken(seed.seam_cst1_token, {
endpoint,
})
const { token } = await seam.clientSessions.create({

const devices = await seam.devices.list()
t.true(devices.length > 0)

const seamUsingApiKey = SeamHttp.fromApiKey(seed.seam_apikey2_token, {
endpoint,
})

const { token } = await seamUsingApiKey.clientSessions.create({
user_identifier_key: 'some-new-user-identifier-key',
})

await seam.updateClientSessionToken(token)
const devices = await seam.devices.list()
t.is(devices.length, 0)
const devicesFromNewSession = await seam.devices.list()
t.is(devicesFromNewSession.length, 0)
})

test('SeamHttp: updateClientSessionToken fails if no existing clientSessionToken', async (t) => {
Expand Down Expand Up @@ -92,6 +100,6 @@ test('SeamHttp: updateClientSessionToken checks clientSessionToken is authorized
instanceOf: SeamHttpApiError,
},
)
t.is(err?.statusCode, 404)
t.is(err?.code, 'client_session_token_not_found')
t.is(err?.statusCode, 401)
t.is(err?.code, 'unauthorized')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the assertions according to this

})
Loading