test relative timestamp

This commit is contained in:
Annika Hannig 2023-01-26 10:53:11 +01:00
parent e8c2a9c7fd
commit 4455ade49e

View File

@ -0,0 +1,14 @@
import {render, screen} from '@testing-library/react';
import RelativeTimestamp from 'app/components/datetime/RelativeTimestamp';
test("render a relative timestamp", () => {
const t = 15 * 60 * 1000 * 1000 * 1000; // 15 min
render(<p data-testid="result"><RelativeTimestamp value={t} /></p>);
const result = screen.getByTestId("result");
expect(result.innerHTML).toBe("15 minutes ago");
});