From a49928542f6aed63d7d936ebabdc2c80a230d778 Mon Sep 17 00:00:00 2001 From: Caden Buckhalt Date: Mon, 2 Dec 2024 16:33:41 -0600 Subject: [PATCH] update tests to expect all edges should not expect filtered edges for node filtering --- lib/network-query/__tests__/filter.test.js | 4 ++-- lib/network-query/__tests__/rules.test.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/network-query/__tests__/filter.test.js b/lib/network-query/__tests__/filter.test.js index b26ac6b7..bfa40d2a 100644 --- a/lib/network-query/__tests__/filter.test.js +++ b/lib/network-query/__tests__/filter.test.js @@ -262,7 +262,7 @@ describe('filter', () => { (node) => node[entityAttributesProperty].name, ); expect(names).toEqual(['William', 'Theodore', 'Rufus']); - expect(result.edges.length).toEqual(3); + expect(result.edges.length).toEqual(4); }); it.todo('can filter edges by type (not)'); @@ -282,7 +282,7 @@ describe('filter', () => { const filter = getFilter(filterConfig); const result = filter(network); - expect(result.edges.length).toEqual(2); + expect(result.edges.length).toEqual(4); }); }); }); diff --git a/lib/network-query/__tests__/rules.test.js b/lib/network-query/__tests__/rules.test.js index f3b62d0e..0a1bdea4 100644 --- a/lib/network-query/__tests__/rules.test.js +++ b/lib/network-query/__tests__/rules.test.js @@ -232,7 +232,7 @@ describe('rules', () => { const { nodeNames, edges } = runRuleHelper(ruleConfig); expect(nodeNames).toEqual(['William', 'Theodore', 'Rufus']); - expect(edges.length).toEqual(2); + expect(edges.length).toEqual(4); }); it('NOT_EXISTS', () => { @@ -248,7 +248,7 @@ describe('rules', () => { 'Phone Box', 'Pillar Box', ]); - expect(edges.length).toEqual(2); + expect(edges.length).toEqual(4); }); describe('attribute rules', () => { @@ -268,7 +268,7 @@ describe('rules', () => { const { nodeNames, edges } = runRuleHelper(ruleConfig); expect(nodeNames).toEqual(['William', 'Theodore']); - expect(edges.length).toEqual(1); + expect(edges.length).toEqual(4); }); it('NOT', () => { @@ -281,7 +281,7 @@ describe('rules', () => { const { nodeNames, edges } = runRuleHelper(ruleConfig); expect(nodeNames).toEqual(['Theodore', 'Rufus']); - expect(edges.length).toEqual(1); + expect(edges.length).toEqual(4); }); it('GREATER_THAN', () => { @@ -294,7 +294,7 @@ describe('rules', () => { const { nodeNames, edges } = runRuleHelper(ruleConfig); expect(nodeNames).toEqual(['William', 'Theodore']); - expect(edges.length).toEqual(1); + expect(edges.length).toEqual(4); }); it('LESS_THAN', () => { @@ -307,7 +307,7 @@ describe('rules', () => { const { nodeNames, edges } = runRuleHelper(ruleConfig); expect(nodeNames).toEqual(['Theodore', 'Rufus']); - expect(edges.length).toEqual(1); + expect(edges.length).toEqual(4); }); it('GREATER_THAN_OR_EQUAL', () => { @@ -320,7 +320,7 @@ describe('rules', () => { const { nodeNames, edges } = runRuleHelper(ruleConfig); expect(nodeNames).toEqual(['William', 'Theodore']); - expect(edges.length).toEqual(1); + expect(edges.length).toEqual(4); }); it('LESS_THAN_OR_EQUAL', () => { @@ -333,7 +333,7 @@ describe('rules', () => { const { nodeNames, edges } = runRuleHelper(ruleConfig); expect(nodeNames).toEqual(['Theodore', 'Rufus']); - expect(edges.length).toEqual(1); + expect(edges.length).toEqual(4); }); }); });