[v10.2.x] Chore: Fix formatter test (#76867)

Chore: Fix formatter test (#76689)

(cherry picked from commit 0ddc3d4a49)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2023-10-23 15:33:24 +02:00
committed by Horst Gutmann
co-authored by Andres Martinez Gotor
parent ce793fe47b
commit 895fbafb7a
@@ -97,17 +97,9 @@ describe('dateTimeFormat', () => {
});
describe('dateTimeFormatTimeAgo', () => {
it('should return the correct format for 3 years ago', () => {
it('should return the correct format for years ago', () => {
const options = { timeZone: 'Europe/Stockholm' };
expect(dateTimeFormatTimeAgo(1587126975779, options)).toBe('3 years ago');
});
it('should return the correct format for 2 year ago', () => {
const options = { timeZone: 'Europe/Stockholm' };
expect(dateTimeFormatTimeAgo(1626154993000, options)).toBe('2 years ago');
});
it('should return the correct format for 1 year ago', () => {
const options = { timeZone: 'Europe/Stockholm' };
expect(dateTimeFormatTimeAgo(1657731795000, options)).toBe('a year ago');
expect(dateTimeFormatTimeAgo(1587126975779, options)).toContain('years ago');
});
});
describe('dateTimeFormatWithAbbreviation', () => {