From 022c99ff3362a80277c3a2b1e9d72ac0d50020d1 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Sun, 1 May 2022 17:34:08 +0200 Subject: [PATCH] Front: fix button with history when changing path --- src/main/webapp/app/springboot/primary/Generator.component.ts | 2 +- src/test/javascript/spec/springboot/primary/Generator.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/springboot/primary/Generator.component.ts b/src/main/webapp/app/springboot/primary/Generator.component.ts index c77e5bf3d2c..244437c0592 100644 --- a/src/main/webapp/app/springboot/primary/Generator.component.ts +++ b/src/main/webapp/app/springboot/primary/Generator.component.ts @@ -42,7 +42,7 @@ export default defineComponent({ const getCurrentProjectHistory = (): Promise => projectHistoryService.get(project.value.folder); const debounceGetProjectHistory = (): void => { if (timeoutId) globalWindow.clearTimeout(timeoutId); - timeoutId = globalWindow.setTimeout(() => getCurrentProjectHistory, 400); + timeoutId = globalWindow.setTimeout(() => getCurrentProjectHistory(), 400); }; return { diff --git a/src/test/javascript/spec/springboot/primary/Generator.spec.ts b/src/test/javascript/spec/springboot/primary/Generator.spec.ts index 87222772199..ef888b89f11 100644 --- a/src/test/javascript/spec/springboot/primary/Generator.spec.ts +++ b/src/test/javascript/spec/springboot/primary/Generator.spec.ts @@ -67,7 +67,7 @@ describe('Generator', () => { component.debounceGetProjectHistory(); const [delayedMethod, timeout] = globalWindow.setTimeout.getCall(0).args; - expect(delayedMethod()).toEqual(component.getCurrentProjectHistory); + expect(delayedMethod()).toEqual(component.getCurrentProjectHistory()); expect(timeout).toBe(400); expect(globalWindow.clearTimeout.called).toBe(false); });