fix(backend): Proper import of archived repo
Not really sure what happened, but clearly when I imported our backend code into our monorepo, it was not the latest version. So I'm fixing this now by putting in the latest code. I will re-apply the changes since later.
This commit is contained in:
parent
bcfb919172
commit
ca8ceb1a30
90 changed files with 4337 additions and 2693 deletions
40
packages/backend/tests/oauth.test.js
Normal file
40
packages/backend/tests/oauth.test.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
module.exports = function tests(store, config, chai) {
|
||||
|
||||
describe('Oauth via Github', () => {
|
||||
it('should trigger Oauth via Github', done => {
|
||||
chai
|
||||
.request(config.backend)
|
||||
.post('/oauth/init')
|
||||
.send({
|
||||
provider: 'github',
|
||||
language: 'en'
|
||||
})
|
||||
.end((err, res) => {
|
||||
res.should.have.status(200)
|
||||
let data = JSON.parse(res.text)
|
||||
data.state.should.be.a('string')
|
||||
config.oauth.github.state = data.state
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should trigger Oauth via Google', done => {
|
||||
chai
|
||||
.request(config.backend)
|
||||
.post('/oauth/init')
|
||||
.send({
|
||||
provider: 'github',
|
||||
language: 'en'
|
||||
})
|
||||
.end((err, res) => {
|
||||
res.should.have.status(200)
|
||||
let data = JSON.parse(res.text)
|
||||
data.state.should.be.a('string')
|
||||
config.oauth.google.state = data.state
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
// FIXME: Test the rest of the Oauth flow (perhaps easier to do from the frontend)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue