feature-change-applier/src/App.test.js

21 lines
754 B
JavaScript
Raw Normal View History

2019-11-20 00:06:56 +00:00
import React from 'react';
import ReactDOM from 'react-dom';
2020-02-29 20:59:33 +00:00
import { HashRouter as Router } from 'react-router-dom';
2019-11-20 00:06:56 +00:00
import App from './App';
2019-11-26 04:35:46 +00:00
import renderer from 'react-test-renderer';
import { exportAllDeclaration } from '@babel/types';
import {render} from '@testing-library/react';
import extendExpect from '@testing-library/jest-dom/extend-expect'
2019-11-20 00:06:56 +00:00
it('renders App without crashing', () => {
2019-11-20 00:06:56 +00:00
const div = document.createElement('div');
2020-02-29 20:59:33 +00:00
ReactDOM.render(<Router><App /></Router>, div);
2019-11-20 00:06:56 +00:00
ReactDOM.unmountComponentAtNode(div);
});
2019-11-26 04:35:46 +00:00
describe('App', () => {
it('renders the correct title', () => {
2020-02-29 20:59:33 +00:00
const { getByTestId } = render(<Router><App /></Router>);
expect(getByTestId('App-name')).toHaveTextContent('Feature Change Applier');
2019-11-26 04:35:46 +00:00
})
})