test relative timestamp
This commit is contained in:
parent
e8c2a9c7fd
commit
4455ade49e
14
ui/src/app/components/datetime/RelativeTimestamp.test.js
Normal file
14
ui/src/app/components/datetime/RelativeTimestamp.test.js
Normal 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");
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user