stub phonetic Features

This commit is contained in:
Sorrel Bri 2019-11-26 18:44:07 -08:00
parent 46f1b2a831
commit 983e858b7b
3 changed files with 34 additions and 3 deletions

View file

@ -2,6 +2,7 @@ import React, { useState } from 'react';
import './PhonoChangeApplier.scss';
import ProtoLang from './components/ProtoLang';
import Features from './components/Features';
const PhonoChangeApplier = () => {
const [ lexicon, setLexicon ] = useState(['one'])
@ -9,6 +10,7 @@ const PhonoChangeApplier = () => {
return (
<div className="PhonoChangeApplier" data-testid="PhonoChangeApplier">
<ProtoLang lexicon={lexicon} setLexicon={setLexicon}/>
<Features />
</div>
);
}

View file

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

View file

@ -0,0 +1,27 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Features from './Features';
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 Features without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<Features />, div);
ReactDOM.unmountComponentAtNode(div);
});
describe('Features', () => {
it('renders the correct subtitle', () => {
const { getByTestId } = render(<Features />);
expect(getByTestId('Features')).toHaveTextContent('Phonetic Features');
})
// it('renders lexicon from state', () => {
// const { getByTestId } = render(<Features />);
// expect(getByTestId('Features'));
// })
})