mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
21 lines
576 B
TypeScript
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();
|
|
});
|
|
});
|