fix(Microsoft Excel 365 Node): Better error and description on unsupported range in upsert, update, getRange operations (#8452)

This commit is contained in:
Michael Kret
2024-01-26 13:33:29 +00:00
committed by GitHub
parent c70fa66e76
commit 8a595d1527
5 changed files with 51 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ import { mock } from 'jest-mock-extended';
import type { IDataObject, IExecuteFunctions, IGetNodeParameterOptions, INode } from 'n8n-workflow';
import { constructExecutionMetaData } from 'n8n-core';
import {
checkRange,
prepareOutput,
updateByAutoMaping,
updateByDefinedValues,
@@ -491,7 +492,7 @@ describe('Test MicrosoftExcelV2, updateByAutoMaping', () => {
expect(updateSummary.updatedData[4][1]).toEqual('Ismael'); // updated value
});
it('should update all occurances', () => {
it('should update all occurrences', () => {
const items = [
{
json: {
@@ -556,3 +557,19 @@ describe('Test MicrosoftExcelV2, updateByAutoMaping', () => {
expect(updateSummary.appendData[1]).toEqual({ id: 5, name: 'Victor', age: 67, data: 'data 5' });
});
});
describe('Test MicrosoftExcelV2, checkRange', () => {
it('should not throw error', () => {
const range = 'A1:D4';
expect(() => {
checkRange(node, range);
}).not.toThrow();
});
it('should throw error', () => {
const range = 'A:D';
expect(() => {
checkRange(node, range);
}).toThrow();
});
});