Skip to content

Commit

Permalink
Front: fix button with history when changing path
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalgrimaud committed May 1, 2022
1 parent 6a12d49 commit 022c99f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default defineComponent({
const getCurrentProjectHistory = (): Promise<History> => projectHistoryService.get(project.value.folder);
const debounceGetProjectHistory = (): void => {
if (timeoutId) globalWindow.clearTimeout(timeoutId);
timeoutId = globalWindow.setTimeout(() => getCurrentProjectHistory, 400);
timeoutId = globalWindow.setTimeout(() => getCurrentProjectHistory(), 400);
};

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 022c99f

Please sign in to comment.