diff --git a/src/PhonoChangeApplier.js b/src/PhonoChangeApplier.js index 1dec8b6..53b6ff3 100644 --- a/src/PhonoChangeApplier.js +++ b/src/PhonoChangeApplier.js @@ -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 (
+
); } diff --git a/src/components/Features.js b/src/components/Features.js index a852fdd..0bfabfd 100644 --- a/src/components/Features.js +++ b/src/components/Features.js @@ -2,9 +2,11 @@ import React from 'react'; import './Features.scss'; const Features = () => { - return (<> - - ); + return ( +
+

Phonetic Features

+
+ ); } export default Features; \ No newline at end of file diff --git a/src/components/Features.test.js b/src/components/Features.test.js new file mode 100644 index 0000000..351877d --- /dev/null +++ b/src/components/Features.test.js @@ -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(, div); + ReactDOM.unmountComponentAtNode(div); +}); + + + +describe('Features', () => { + it('renders the correct subtitle', () => { + const { getByTestId } = render(); + expect(getByTestId('Features')).toHaveTextContent('Phonetic Features'); + }) + + // it('renders lexicon from state', () => { + // const { getByTestId } = render(); + // expect(getByTestId('Features')); + // }) +}) \ No newline at end of file