浏览代码

companion: fix tests

ifedapoolarewaju 5 年之前
父节点
当前提交
c0c5b3edfb
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      packages/@uppy/companion/test/__tests__/companion.js
  2. 1 1
      packages/@uppy/companion/test/mockserver.js

+ 2 - 2
packages/@uppy/companion/test/__tests__/companion.js

@@ -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>

+ 1 - 1
packages/@uppy/companion/test/mockserver.js

@@ -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()
 })