mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(Item List Output Parser Node): Fix number of items parameter issue (#11696)
This commit is contained in:
@@ -35,6 +35,7 @@ describe('OutputParserItemList', () => {
|
||||
|
||||
const { response } = await outputParser.supplyData.call(thisArg, 0);
|
||||
expect(response).toBeInstanceOf(N8nItemListOutputParser);
|
||||
expect((response as any).numberOfItems).toBe(3);
|
||||
});
|
||||
|
||||
it('should create a parser with custom number of items', async () => {
|
||||
@@ -50,6 +51,20 @@ describe('OutputParserItemList', () => {
|
||||
expect((response as any).numberOfItems).toBe(5);
|
||||
});
|
||||
|
||||
it('should create a parser with unlimited number of items', async () => {
|
||||
thisArg.getNodeParameter.mockImplementation((parameterName) => {
|
||||
if (parameterName === 'options') {
|
||||
return { numberOfItems: -1 };
|
||||
}
|
||||
|
||||
throw new ApplicationError('Not implemented');
|
||||
});
|
||||
|
||||
const { response } = await outputParser.supplyData.call(thisArg, 0);
|
||||
expect(response).toBeInstanceOf(N8nItemListOutputParser);
|
||||
expect((response as any).numberOfItems).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should create a parser with custom separator', async () => {
|
||||
thisArg.getNodeParameter.mockImplementation((parameterName) => {
|
||||
if (parameterName === 'options') {
|
||||
|
||||
Reference in New Issue
Block a user