2022-06-09 13:33:10 +02:00
|
|
|
require("../../tests/utilities/TestConfiguration")
|
|
|
|
const { structures } = require("../../tests/utilities")
|
2022-04-05 17:56:28 +02:00
|
|
|
const utils = require("../utils")
|
|
|
|
const events = require("../events")
|
2022-05-31 22:04:41 +02:00
|
|
|
const { doInTenant, DEFAULT_TENANT_ID }= require("../context")
|
2022-04-05 17:56:28 +02:00
|
|
|
|
|
|
|
describe("utils", () => {
|
|
|
|
describe("platformLogout", () => {
|
|
|
|
it("should call platform logout", async () => {
|
2022-05-31 22:04:41 +02:00
|
|
|
await doInTenant(DEFAULT_TENANT_ID, async () => {
|
|
|
|
const ctx = structures.koa.newContext()
|
|
|
|
await utils.platformLogout({ ctx, userId: "test" })
|
|
|
|
expect(events.auth.logout).toBeCalledTimes(1)
|
|
|
|
})
|
2022-04-05 17:56:28 +02:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|