companion: fix tests

This commit is contained in:
ifedapoolarewaju 2020-02-06 15:57:22 +01:00
parent deec61bc4e
commit c0c5b3edfb
No known key found for this signature in database
GPG key ID: FF050AA4EEBCE82E
2 changed files with 3 additions and 3 deletions

View file

@ -94,10 +94,10 @@ describe('test authentication', () => {
test('the token gets sent via cookie and html', () => {
// see mock ../../src/server/helpers/oauth-state above for state values
return request(authServer)
.get(`/drive/send-token?uppyAuthToken=${token}&state=state-with-newer-version`)
.get(`/dropbox/send-token?uppyAuthToken=${token}&state=state-with-newer-version`)
.expect(200)
.expect((res) => {
const authToken = res.header['set-cookie'][0].split(';')[0].split('uppyAuthToken--google=')[1]
const authToken = res.header['set-cookie'][0].split(';')[0].split('uppyAuthToken--dropbox=')[1]
expect(authToken).toEqual(token)
const body = `
<!DOCTYPE html>

View file

@ -11,7 +11,7 @@ authServer.all('*/callback', (req, res, next) => {
}
next()
})
authServer.all('/drive/send-token', (req, res, next) => {
authServer.all('*/send-token', (req, res, next) => {
req.session.grant = { dynamic: { state: req.query.state || 'non-empty-value' } }
next()
})