mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
fix(Google Sheets Node): Do not delete row_number key from input item (#13158)
This commit is contained in:
@@ -15,7 +15,7 @@ describe('Google Sheet - Append', () => {
|
||||
});
|
||||
|
||||
it('should insert input data if sheet is empty', async () => {
|
||||
mockExecuteFunctions.getInputData.mockReturnValueOnce([
|
||||
const inputData = [
|
||||
{
|
||||
json: {
|
||||
row_number: 3,
|
||||
@@ -27,7 +27,8 @@ describe('Google Sheet - Append', () => {
|
||||
input: undefined,
|
||||
},
|
||||
},
|
||||
]);
|
||||
];
|
||||
mockExecuteFunctions.getInputData.mockReturnValueOnce(inputData);
|
||||
|
||||
mockExecuteFunctions.getNode.mockReturnValueOnce(mock<INode>({ typeVersion: 4.5 }));
|
||||
mockExecuteFunctions.getNodeParameter
|
||||
@@ -55,5 +56,6 @@ describe('Google Sheet - Append', () => {
|
||||
range: 'Sheet1',
|
||||
valueInputMode: 'USER_ENTERED',
|
||||
});
|
||||
expect(inputData[0].json).toEqual({ row_number: 3, name: 'NEW NAME', text: 'NEW TEXT' });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -278,7 +278,9 @@ export async function autoMapInputData(
|
||||
}
|
||||
});
|
||||
if (item.json[ROW_NUMBER]) {
|
||||
delete item.json[ROW_NUMBER];
|
||||
const { [ROW_NUMBER]: _, ...json } = item.json;
|
||||
returnData.push(json);
|
||||
return;
|
||||
}
|
||||
returnData.push(item.json);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user