fix: Use MS Excel as default Sheets export format (#36406)

Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
n8n-cat-bot[bot]
2026-08-21 10:51:27 +00:00
committed by GitHub
parent e1f849307c
commit b9bdaff5f4
2 changed files with 39 additions and 1 deletions
@@ -91,4 +91,42 @@ describe('test GoogleDriveV2: file download', () => {
{ encoding: 'arraybuffer', json: false, returnFullResponse: true, useStream: true },
);
});
it('should export Google Sheets with a supported format by default', async () => {
const nodeParameters = {
operation: 'download',
fileId: {
__rl: true,
value: 'fileIDxxxxxx',
mode: 'list',
},
options: {},
};
(transport.googleApiRequest as Mock)
.mockResolvedValueOnce({ mimeType: 'application/vnd.google-apps.spreadsheet', name: 'test' })
.mockResolvedValueOnce({
headers: {
'content-type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
},
body: Buffer.from(''),
});
const fakeExecuteFunction = createMockExecuteFunction(nodeParameters, driveNode);
await download.execute.call(fakeExecuteFunction, 0, { json: {} });
expect(transport.googleApiRequest).toHaveBeenCalledTimes(2);
expect(transport.googleApiRequest).toHaveBeenNthCalledWith(
2,
'GET',
'/drive/v3/files/fileIDxxxxxx/export',
{},
{
mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
supportsAllDrives: true,
},
undefined,
{ encoding: 'arraybuffer', json: false, returnFullResponse: true, useStream: true },
);
});
});
@@ -232,7 +232,7 @@ export async function execute(
mime = this.getNodeParameter(
`${parameterKey}.sheetsToFormat`,
i,
'application/x-vnd.oasis.opendocument.spreadsheet',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
) as string;
} else {
mime = this.getNodeParameter(`${parameterKey}.drawingsToFormat`, i, 'image/jpeg') as string;