diff --git a/tests/resources/auth.spec.ts b/tests/resources/auth.spec.ts index 6294d8ed..7725aa07 100644 --- a/tests/resources/auth.spec.ts +++ b/tests/resources/auth.spec.ts @@ -247,7 +247,6 @@ describe('Auth', () => { it('should call apiClient.request with the correct params', async () => { await auth.detectProvider({ email: 'email@example.com', - clientId: 'testClientId', allProviderTypes: true, }); }); diff --git a/tests/resources/folders.spec.ts b/tests/resources/folders.spec.ts index 017802af..a429bd53 100644 --- a/tests/resources/folders.spec.ts +++ b/tests/resources/folders.spec.ts @@ -1,5 +1,6 @@ import APIClient from '../../src/apiClient'; import { Folders } from '../../src/resources/folders'; +import { objKeysToCamelCase } from '../../src/utils'; jest.mock('../../src/apiClient'); describe('Folders', () => { @@ -17,6 +18,41 @@ describe('Folders', () => { apiClient.request.mockResolvedValue({}); }); + describe('deserializing', () => { + it('should return a folder object as expected', () => { + const apiFolder = { + id: 'SENT', + grant_id: '41009df5-bf11-4c97-aa18-b285b5f2e386', + name: 'SENT', + system_folder: true, + object: 'folder', + unread_count: 0, + child_count: 0, + parent_id: 'ascsf21412', + background_color: '#039BE5', + text_color: '#039BE5', + total_count: 0, + attributes: ['\\SENT'], + }; + + const folder = objKeysToCamelCase(apiFolder); + expect(folder).toEqual({ + id: 'SENT', + grantId: '41009df5-bf11-4c97-aa18-b285b5f2e386', + name: 'SENT', + systemFolder: true, + object: 'folder', + unreadCount: 0, + childCount: 0, + parentId: 'ascsf21412', + backgroundColor: '#039BE5', + textColor: '#039BE5', + totalCount: 0, + attributes: ['\\SENT'], + }); + }); + }); + describe('list', () => { it('should call apiClient.request with the correct params', async () => { await folders.list({