render ProtoLang from PhonoChangeApplier

This commit is contained in:
Sorrel Bri 2019-11-26 15:09:51 -08:00
parent cb2696b5cd
commit 6a7a563189
5 changed files with 35 additions and 8 deletions

View file

@ -6,7 +6,7 @@ import { exportAllDeclaration } from '@babel/types';
import {render} from '@testing-library/react'; import {render} from '@testing-library/react';
import extendExpect from '@testing-library/jest-dom/extend-expect' import extendExpect from '@testing-library/jest-dom/extend-expect'
it('renders without crashing', () => { it('renders App without crashing', () => {
const div = document.createElement('div'); const div = document.createElement('div');
ReactDOM.render(<App />, div); ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div); ReactDOM.unmountComponentAtNode(div);

View file

@ -1,10 +1,14 @@
import React from 'react'; import React from 'react';
import './PhonoChangeApplier.scss'; import './PhonoChangeApplier.scss';
import ProtoLang from './components/ProtoLang';
const PhonoChangeApplier = () => { const PhonoChangeApplier = () => {
return (<> return (
<div className="PhonoChangeApplier" data-testid="PhonoChangeApplier">
</>); <ProtoLang />
</div>
);
} }
export default PhonoChangeApplier; export default PhonoChangeApplier;

View file

@ -0,0 +1,21 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import PhonoChangeApplier from './PhonoChangeApplier';
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'
it('renders PhonoChangeApplier without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<PhonoChangeApplier />, div);
ReactDOM.unmountComponentAtNode(div);
});
describe('App', () => {
it('renders Proto Language Lexicon', () => {
const { getByTestId } = render(<PhonoChangeApplier />);
expect(getByTestId('PhonoChangeApplier')).toHaveTextContent('Proto Language Lexicon');
})
})

View file

@ -2,9 +2,11 @@ import React from 'react';
import './ProtoLang.scss'; import './ProtoLang.scss';
const ProtoLang = () => { const ProtoLang = () => {
return (<> return (
<div className="ProtoLang" data-testid="ProtoLang">
</>); <h3>Proto Language Lexicon</h3>
</div>
);
} }
export default ProtoLang; export default ProtoLang;

View file

@ -6,7 +6,7 @@ import { exportAllDeclaration } from '@babel/types';
import {render} from '@testing-library/react'; import {render} from '@testing-library/react';
import extendExpect from '@testing-library/jest-dom/extend-expect' import extendExpect from '@testing-library/jest-dom/extend-expect'
it('renders without crashing', () => { it('renders ProtoLang without crashing', () => {
const div = document.createElement('div'); const div = document.createElement('div');
ReactDOM.render(<ProtoLang />, div); ReactDOM.render(<ProtoLang />, div);
ReactDOM.unmountComponentAtNode(div); ReactDOM.unmountComponentAtNode(div);