feat: Show year in message timestamp if the message is not from the current year (#6830)
* feat: Shows year in message timestamp if the message is not from the current year * chore: Naming fix
This commit is contained in:
@@ -9,6 +9,20 @@ describe('#messageStamp', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#messageTimestamp', () => {
|
||||
it('should return the message date in the specified format if the message was sent in the current year', () => {
|
||||
const now = new Date();
|
||||
expect(TimeMixin.methods.messageTimestamp(now.getTime() / 1000)).toEqual(
|
||||
'Apr 5, 2023'
|
||||
);
|
||||
});
|
||||
it('should return the message date and time in a different format if the message was sent in a different year', () => {
|
||||
expect(TimeMixin.methods.messageTimestamp(1612971343)).toEqual(
|
||||
'Feb 10 2021, 3:35 PM'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#dynamicTime', () => {
|
||||
it('returns correct value', () => {
|
||||
expect(TimeMixin.methods.dynamicTime(1612971343)).toEqual(
|
||||
|
||||
Reference in New Issue
Block a user