feat: Modify api key and sales channel link to use modules and add test (#6546)

This commit is contained in:
Stevche Radevski
2024-03-01 09:24:50 +00:00
committed by GitHub
parent 55275f0eba
commit 196e821ff2
12 changed files with 146 additions and 17 deletions
@@ -284,6 +284,19 @@ moduleIntegrationTestRunner({
expect(apiKeysInDatabase).toHaveLength(2)
})
it("should only return keys with matching token", async function () {
const created = await service.create([
createPublishableKeyFixture,
createPublishableKeyFixture,
])
const apiKeysInDatabase = await service.list({
token: created[0].token,
})
expect(apiKeysInDatabase).toHaveLength(1)
expect(apiKeysInDatabase[0].token).toEqual(created[0].token)
})
it("should not return the token and salt for secret keys when listing", async function () {
await service.create([createSecretKeyFixture])