Merge pull request #13864 from Budibase/feature/current-user-global-id-binding
Adding test for globalId in self call
This commit is contained in:
commit
748555b71b
|
@ -1,5 +1,8 @@
|
|||
const setup = require("./utilities")
|
||||
const { generateUserMetadataID } = require("../../../db/utils")
|
||||
const {
|
||||
generateUserMetadataID,
|
||||
getGlobalIDFromUserMetadataID,
|
||||
} = require("../../../db/utils")
|
||||
|
||||
describe("/authenticate", () => {
|
||||
let request = setup.getRequest()
|
||||
|
@ -20,5 +23,16 @@ describe("/authenticate", () => {
|
|||
.expect(200)
|
||||
expect(res.body._id).toEqual(generateUserMetadataID(config.user._id))
|
||||
})
|
||||
|
||||
it("should container the global user ID", async () => {
|
||||
const res = await request
|
||||
.get(`/api/self`)
|
||||
.set(config.defaultHeaders())
|
||||
.expect("Content-Type", /json/)
|
||||
.expect(200)
|
||||
expect(res.body.globalId).toEqual(
|
||||
getGlobalIDFromUserMetadataID(config.user._id)
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue