stub phonetic Features
This commit is contained in:
parent
46f1b2a831
commit
983e858b7b
3 changed files with 34 additions and 3 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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;
|
27
src/components/Features.test.js
Normal file
27
src/components/Features.test.js
Normal 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'));
|
||||
// })
|
||||
})
|
Loading…
Reference in a new issue