Skip to content

Commit

Permalink
fixup! Add monthly commitment average and goal
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Oct 9, 2024
1 parent dd4d992 commit 9baf77e
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,19 @@ describe('useMonthlyCommitmentAverage', () => {
// Increase of $150/month over 12 months
expect(result.current).toEqual({ loading: false, average: 12.5 });
});

it('average is 0 when start and finish dates are in the same month', async () => {
const { result, waitForNextUpdate } = renderHook(
() =>
useMonthlyCommitmentAverage(accountListId, {
activeMpdStartAt: '2019-01-05',
activeMpdFinishAt: '2019-01-25',
}),
{ wrapper: Wrapper },
);

await waitForNextUpdate();

expect(result.current).toEqual({ loading: false, average: 0 });
});
});

0 comments on commit 9baf77e

Please sign in to comment.