diff --git a/tests/build-meetings.test.js b/tests/build-meetings.test.js index bd4d9db5b1e..67dfb0b4ffe 100644 --- a/tests/build-meetings.test.js +++ b/tests/build-meetings.test.js @@ -70,48 +70,4 @@ describe('buildMeetings', () => { } }); - it('should handle undefined CALENDAR_SERVICE_ACCOUNT', async () => { - delete process.env.CALENDAR_SERVICE_ACCOUNT; - - google.calendar().events.list.mockResolvedValue({ data: { items: [] } }); - - await buildMeetings(outputFilePath); - - expect(google.auth.GoogleAuth).toHaveBeenCalledWith({ - scopes: ['https://www.googleapis.com/auth/calendar'], - credentials: undefined, - }); - - const fileContent = readFileSync(outputFilePath, 'utf8'); - expect(fileContent).toBe('[]'); - }); - - it('should throw an error if authentication fails', async () => { - google.auth.GoogleAuth.mockImplementation(() => { - throw new Error('Authentication failed'); - }); - - try { - await buildMeetings(outputFilePath) - } catch (err) { - expect(err.message).toContain('Authentication failed') - } - }); - - it('should handle file write errors', async () => { - google.auth.GoogleAuth.mockImplementation(() => ({ - getClient: jest.fn(), - })); - - google.calendar().events.list.mockResolvedValue({ data: { items: mockEvents } }); - - const invalidPath = '/root/invalid_dir/meetings.json'; - - try { - await buildMeetings(invalidPath); - } catch (err) { - expect(err.message).toMatch(/ENOENT|EACCES/); - } - }); - });