You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
This commit is contained in:
19
packages/lib/onedrive-api.test.ts
Normal file
19
packages/lib/onedrive-api.test.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import OneDriveApi from './onedrive-api';
|
||||
|
||||
describe('onedrive-api', () => {
|
||||
test.each([
|
||||
[{ Authorization: 'testing' }, { Authorization: '[[DELETED]]' }],
|
||||
[{ headers: { Authorization: 'testing' } }, { headers: { Authorization: '[[DELETED]]' } }],
|
||||
[
|
||||
{ foo: { Authorization: 'testing', bar: 'test' }, baz: 'test2', Authorization: 'testing' },
|
||||
{ foo: { Authorization: '[[DELETED]]', bar: 'test' }, baz: 'test2', Authorization: '[[DELETED]]' },
|
||||
],
|
||||
[
|
||||
{ a: { b: { c: { d: { e: { f: { g: 'Test' } } } }, Authorization: 'bearer someidhere' } } },
|
||||
{ a: { b: { c: { d: { e: { f: '[[depth-exceeded]]' } } }, Authorization: '[[DELETED]]' } } },
|
||||
],
|
||||
])('authorizationTokenRemoved should remove Authorization field', (object, expected) => {
|
||||
const api = new OneDriveApi('testID', 'secret', true);
|
||||
expect(api.authorizationTokenRemoved(object)).toMatchObject(expected);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user