Update test case, fix comments

This commit is contained in:
2023-12-03 22:22:36 +07:00
parent d53b869d65
commit 5d5eb1adaf
135 changed files with 8702 additions and 1491 deletions
@@ -11,8 +11,18 @@ describe('formatCurrency', () => {
describe('getDayDiff', () => {
test('Should calculate correctly', () => {
const result = getDayDiff(new Date('2023/11/30'), new Date('2023/12/01'));
const case_1 = getDayDiff(new Date('2023/11/30'), new Date('2023/12/01'));
const case_2 = getDayDiff(new Date('2023/12/15'), new Date('2023/12/20'));
const case_3 = getDayDiff(new Date('2023/12/31'), new Date('2024/01/01'));
expect(result).toEqual(1);
expect(case_1).toEqual(1);
expect(case_2).toEqual(5);
expect(case_3).toEqual(1);
});
test('Should return 0 if startDate larger than endDate', () => {
const result = getDayDiff(new Date('2023/11/30'), new Date('2023/11/20'));
expect(result).toEqual(0);
});
});