Added test case for signInUserWithGithub to check if adding 'repo gist'
This commit is contained in:
parent
f21b5768a5
commit
eeb1ecd2df
1 changed files with 20 additions and 0 deletions
|
|
@ -252,6 +252,26 @@ describe("FirebaseInstance", () => {
|
|||
|
||||
await expect(fb.signInUserWithGithub()).rejects.toEqual("test error")
|
||||
})
|
||||
test("adds 'repo gist' scope", async () => {
|
||||
const fbFunc = jest.spyOn(mockAuth, "signInWithPopup")
|
||||
|
||||
const addScopeMock = jest.fn()
|
||||
|
||||
const fb = new FirebaseInstance(mocksdk, {
|
||||
github: () => {
|
||||
return {
|
||||
addScope: addScopeMock
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
signOutUser()
|
||||
|
||||
fbFunc.mockImplementation(() => Promise.resolve("test"))
|
||||
await fb.signInUserWithGithub()
|
||||
|
||||
expect(addScopeMock).toBeCalledWith("repo gist")
|
||||
})
|
||||
test("resolves the response the firebase request resolves", async () => {
|
||||
const fbFunc = jest.spyOn(mockAuth, "signInWithPopup")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue