From d2949e3f4607e4aa153459254331dd0273953698 Mon Sep 17 00:00:00 2001 From: Luke Cotter <4013877+lukecotter@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:19:35 +0000 Subject: [PATCH] test: fix duration rollup test now that has moved --- log-viewer/modules/__tests__/ApexLogParser.test.ts | 13 ------------- log-viewer/modules/parsers/ApexLogParser.ts | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/log-viewer/modules/__tests__/ApexLogParser.test.ts b/log-viewer/modules/__tests__/ApexLogParser.test.ts index 3e096e8a..01cfb055 100644 --- a/log-viewer/modules/__tests__/ApexLogParser.test.ts +++ b/log-viewer/modules/__tests__/ApexLogParser.test.ts @@ -694,19 +694,6 @@ describe('Recalculate durations tests', () => { expect(node.timestamp).toEqual(1); expect(node.duration).toEqual({ self: 2, total: 2 }); }); - - it('Children are subtracted from net duration', () => { - const node = new Method(['14:32:07.563 (0)', 'DUMMY'], [], 'Method', ''), - child1 = new Method(['14:32:07.563 (10)', 'DUMMY'], [], 'Method', ''), - child2 = new Method(['14:32:07.563 (70)', 'DUMMY'], [], 'Method', ''); - node.exitStamp = 100; - child1.duration.total = 50; - child2.duration.total = 25; - node.addChild(child1); - node.addChild(child2); - node.recalculateDurations(); - expect(node.duration).toEqual({ self: 25, total: 100 }); - }); }); describe('Line Type Tests', () => { diff --git a/log-viewer/modules/parsers/ApexLogParser.ts b/log-viewer/modules/parsers/ApexLogParser.ts index d9e6043d..d1bad419 100644 --- a/log-viewer/modules/parsers/ApexLogParser.ts +++ b/log-viewer/modules/parsers/ApexLogParser.ts @@ -166,7 +166,7 @@ export default class ApexLogParser { this.insertPackageWrappers(rootMethod); this.setNamespaces(rootMethod); - this.aggregateTotals([rootMethod]); + this.aggregateTotals(rootMethod.children); return rootMethod; }