2019-01-31 08:41:32 -08:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { render, cleanup, queryByText } from 'react-testing-library';
|
|
|
|
import { ThemeProvider } from 'styled-components';
|
|
|
|
import 'jest-dom/extend-expect';
|
|
|
|
|
|
|
|
import { TextComponent } from '../../app/components/text';
|
|
|
|
import appTheme from '../../app/theme';
|
|
|
|
|
|
|
|
afterEach(cleanup);
|
|
|
|
|
|
|
|
describe('<TextComponent />', () => {
|
|
|
|
test('should render correctly', () => {
|
|
|
|
const { container } = render(
|
|
|
|
<ThemeProvider theme={appTheme}>
|
|
|
|
<TextComponent value='ZEC React Wallet' />
|
|
|
|
</ThemeProvider>,
|
|
|
|
);
|
|
|
|
|
2019-02-01 05:19:28 -08:00
|
|
|
expect(container).toBeVisible();
|
2019-01-31 08:41:32 -08:00
|
|
|
});
|
|
|
|
|
|
|
|
test('should render input label string', () => {
|
|
|
|
const { container } = render(
|
|
|
|
<ThemeProvider theme={appTheme}>
|
|
|
|
<TextComponent value='Test' />
|
|
|
|
</ThemeProvider>,
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(queryByText(container, /Test/i)).toBeInTheDocument();
|
|
|
|
});
|
|
|
|
});
|