mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
feat(v4): Update Inbox view card design (#10599)
This commit is contained in:
@@ -5,6 +5,8 @@ import {
|
||||
findStartOfNextMonth,
|
||||
findNextDay,
|
||||
setHoursToNine,
|
||||
snoozedReopenTimeToTimestamp,
|
||||
shortenSnoozeTime,
|
||||
} from '../snoozeHelpers';
|
||||
|
||||
describe('#Snooze Helpers', () => {
|
||||
@@ -107,4 +109,45 @@ describe('#Snooze Helpers', () => {
|
||||
expect(findNextDay(today)).toEqual(nextDay);
|
||||
});
|
||||
});
|
||||
|
||||
describe('snoozedReopenTimeToTimestamp', () => {
|
||||
it('should return timestamp if snoozedUntil is not nil', () => {
|
||||
expect(snoozedReopenTimeToTimestamp('2023-06-07T09:00:00.000Z')).toEqual(
|
||||
1686128400
|
||||
);
|
||||
});
|
||||
it('should return nil if snoozedUntil is nil', () => {
|
||||
expect(snoozedReopenTimeToTimestamp(null)).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('shortenSnoozeTime', () => {
|
||||
it('should return shortened time if snoozedUntil is not nil and day is passed', () => {
|
||||
expect(shortenSnoozeTime('1 day')).toEqual('1d');
|
||||
});
|
||||
|
||||
it('should return shortened time if snoozedUntil is not nil and month is passed', () => {
|
||||
expect(shortenSnoozeTime('1 month')).toEqual('1mo');
|
||||
});
|
||||
|
||||
it('should return shortened time if snoozedUntil is not nil and year is passed', () => {
|
||||
expect(shortenSnoozeTime('1 year')).toEqual('1y');
|
||||
});
|
||||
|
||||
it('should return shortened time if snoozedUntil is not nil and hour is passed', () => {
|
||||
expect(shortenSnoozeTime('1 hour')).toEqual('1h');
|
||||
});
|
||||
|
||||
it('should return shortened time if snoozedUntil is not nil and minutes is passed', () => {
|
||||
expect(shortenSnoozeTime('1 minutes')).toEqual('1m');
|
||||
});
|
||||
|
||||
it('should return shortened time if snoozedUntil is not nil and in is passed', () => {
|
||||
expect(shortenSnoozeTime('in 1 hour')).toEqual('1h');
|
||||
});
|
||||
|
||||
it('should return nil if snoozedUntil is nil', () => {
|
||||
expect(shortenSnoozeTime(null)).toEqual(null);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user