1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00
Files
checktheroads-hyperglass/hyperglass/ui/hooks/useStrf.test.tsx
thatmattlove 889e44d6b1 Add UI tests
2021-12-06 16:34:45 -07:00

21 lines
576 B
TypeScript

import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import { useStrf } from './useStrf';
const TEMPLATE = 'Testing {name} hook';
const OBJECT = { name: 'useStrf' };
const FINAL_VALUE = 'Testing useStrf hook';
const TestComponent = (): JSX.Element => {
const strf = useStrf();
const value = strf(TEMPLATE, OBJECT);
return <div>{value}</div>;
};
describe('useStrf Hook', () => {
it('text be formatted', () => {
const { queryByText } = render(<TestComponent />);
expect(queryByText(FINAL_VALUE)).toBeInTheDocument();
});
});