소스 검색

fix broken onedrive and broken tests

Mikael Finstad 2 년 전
부모
커밋
2db5165bd8
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      packages/@uppy/companion/src/server/provider/onedrive/index.js
  2. 4 4
      packages/@uppy/companion/test/__tests__/providers.js

+ 1 - 1
packages/@uppy/companion/src/server/provider/onedrive/index.js

@@ -7,7 +7,7 @@ const { withProviderErrorHandling } = require('../providerErrors')
 const { prepareStream } = require('../../helpers/utils')
 
 const getClient = ({ token }) => got.extend({
-  prefixUrl: 'https://graph.microsoft.com',
+  prefixUrl: 'https://graph.microsoft.com/v1.0',
   headers: {
     authorization: `Bearer ${token}`,
   },

+ 4 - 4
packages/@uppy/companion/test/__tests__/providers.js

@@ -227,11 +227,11 @@ describe('list provider files', () => {
   })
 
   test('onedrive', async () => {
-    nock('https://graph.microsoft.com').get('/me').reply(200, {
+    nock('https://graph.microsoft.com').get('/v1.0/me').reply(200, {
       userPrincipalName: defaults.USERNAME,
       mail: defaults.USERNAME,
     })
-    nock('https://graph.microsoft.com').get('/me/drive/root/children?%24expand=thumbnails').reply(200, {
+    nock('https://graph.microsoft.com').get('/v1.0/me/drive/root/children?%24expand=thumbnails').reply(200, {
       value: [
         {
           createdDateTime: '2020-01-31T15:40:26.197Z',
@@ -354,10 +354,10 @@ describe('provider file gets downloaded from', () => {
   })
 
   test('onedrive', async () => {
-    nock('https://graph.microsoft.com').get(`/drives/DUMMY-DRIVE-ID/items/${defaults.ITEM_ID}`).reply(200, {
+    nock('https://graph.microsoft.com').get(`/v1.0/drives/DUMMY-DRIVE-ID/items/${defaults.ITEM_ID}`).reply(200, {
       size: defaults.FILE_SIZE,
     })
-    nock('https://graph.microsoft.com').get(`/drives/DUMMY-DRIVE-ID/items/${defaults.ITEM_ID}/content`).reply(200, {})
+    nock('https://graph.microsoft.com').get(`/v1.0/drives/DUMMY-DRIVE-ID/items/${defaults.ITEM_ID}/content`).reply(200, {})
     await runTest('onedrive')
   })