render Output component

This commit is contained in:
Sorrel Bri 2019-11-29 23:49:51 -08:00
parent c3e4650ad7
commit caa8da5ded
3 changed files with 35 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import ProtoLang from './components/ProtoLang';
import Features from './components/Features';
import Epochs from './components/Epochs';
import Options from './components/Options';
import Output from './components/Output';
const PhonoChangeApplier = () => {
const [ lexicon, setLexicon ] = useState(['one']);
@ -25,6 +26,7 @@ const PhonoChangeApplier = () => {
<Features phonemes={phonemes} setPhonemes={setPhonemes}/>
<Epochs epochs={epochs} setEpochs={setEpochs}/>
<Options options={options} setOptions={setOptions} runChanges={runChanges}/>
<Output />
</div>
);
}

View file

@ -1,10 +1,12 @@
import React from 'react';
import './Output.scss';
const Output = () => {
return (<>
</>);
const Output = props => {
return (
<div className="Output" data-testid="Output">
<h3>Results of Run</h3>
</div>
);
}
export default Output;

View file

@ -0,0 +1,27 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Output from './Output';
import renderer from 'react-test-renderer';
import {render, fireEvent} from '@testing-library/react';
import extendExpect from '@testing-library/jest-dom/extend-expect'
it('renders Output without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Output />, div);
ReactDOM.unmountComponentAtNode(div);
});
describe('Output', () => {
it('renders the correct subtitle', () => {
const { getByTestId } = render(<Output />);
expect(getByTestId('Output')).toHaveTextContent('Results of Run');
});
it('renders output lexicon list from output hook', () => {
const { getByTestId } = render(<Output />);
// expect(getByTestId('Output-list'));
});
});