Skip to content

Commit

Permalink
fix broken onedrive and broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Aug 16, 2022
1 parent 15b6b01 commit d7ce8bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/server/provider/onedrive/index.js
Expand Up @@ -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}`,
},
Expand Down
8 changes: 4 additions & 4 deletions test/__tests__/providers.js
Expand Up @@ -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',
Expand Down Expand Up @@ -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')
})

Expand Down

0 comments on commit d7ce8bd

Please sign in to comment.