From 857889d1faf0cc2e7fd5b51d34ff3ac46b47b18e Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sun, 19 May 2024 00:56:16 +1000 Subject: [PATCH] tests(ui): coverage for getCollectItemType --- .../features/nodes/store/util/getCollectItemType.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/invokeai/frontend/web/src/features/nodes/store/util/getCollectItemType.test.ts b/invokeai/frontend/web/src/features/nodes/store/util/getCollectItemType.test.ts index 93c63b6f41..7f0a96bf33 100644 --- a/invokeai/frontend/web/src/features/nodes/store/util/getCollectItemType.test.ts +++ b/invokeai/frontend/web/src/features/nodes/store/util/getCollectItemType.test.ts @@ -13,4 +13,10 @@ describe(getCollectItemType.name, () => { const result = getCollectItemType(templates, nodes, edges, n2.id); expect(result).toEqual({ name: 'IntegerField', isCollection: false, isCollectionOrScalar: false }); }); + it('should return null if the collect node does not have any connections', () => { + const n1 = buildInvocationNode(position, collect); + const nodes = [n1]; + const result = getCollectItemType(templates, nodes, [], n1.id); + expect(result).toBeNull(); + }); });