Adding test.
This commit is contained in:
parent
c57a81c6de
commit
878114133c
|
@ -1,5 +1,8 @@
|
||||||
const setup = require("./utilities")
|
const setup = require("./utilities")
|
||||||
const { generateUserMetadataID } = require("../../../db/utils")
|
const {
|
||||||
|
generateUserMetadataID,
|
||||||
|
getGlobalIDFromUserMetadataID,
|
||||||
|
} = require("../../../db/utils")
|
||||||
|
|
||||||
describe("/authenticate", () => {
|
describe("/authenticate", () => {
|
||||||
let request = setup.getRequest()
|
let request = setup.getRequest()
|
||||||
|
@ -20,5 +23,16 @@ describe("/authenticate", () => {
|
||||||
.expect(200)
|
.expect(200)
|
||||||
expect(res.body._id).toEqual(generateUserMetadataID(config.user._id))
|
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