chore: Remove older UI (#11720)

This commit is contained in:
Sivin Varghese
2025-07-01 09:43:44 +05:30
committed by GitHub
parent 58da92a252
commit 24ea968b00
369 changed files with 974 additions and 9363 deletions

View File

@@ -1,10 +1,8 @@
import {
formatDate,
formatUnixDate,
formatDigitToString,
isTimeAfter,
generateRelativeTime,
getDayDifferenceFromNow,
} from '../DateHelper';
describe('#DateHelper', () => {
@@ -47,14 +45,6 @@ describe('#DateHelper', () => {
).toEqual('Yesterday');
});
});
describe('#formatDigitToString', () => {
it('returns date compatabile string from number is less than 9', () => {
expect(formatDigitToString(8)).toEqual('08');
});
it('returns date compatabile string from number is greater than 9', () => {
expect(formatDigitToString(11)).toEqual('11');
});
});
describe('#isTimeAfter', () => {
it('return correct values', () => {
@@ -121,25 +111,3 @@ describe('generateRelativeTime', () => {
expect(actualResult).toBe(expectedResult);
});
});
describe('#getDayDifferenceFromNow', () => {
it('should return the difference if in same day', () => {
const now = new Date('2023-12-08T00:00:00.000Z');
const timestampInSeconds = 1702020305; // 08/12/2023, 12:55:05 (GMT+05:30)
const expectedResult = 0;
const actualResult = getDayDifferenceFromNow(now, timestampInSeconds);
expect(actualResult).toBe(expectedResult);
});
it('should return the difference if in different day', () => {
const now = new Date('2023-12-11T00:00:00.000Z');
const timestampInSeconds = 1702020305; // 08/12/2023, 12:55:05 (GMT+05:30)
const expectedResult = 2;
const actualResult = getDayDifferenceFromNow(now, timestampInSeconds);
expect(actualResult).toBe(expectedResult);
});
});