render single sound change in single suite
This commit is contained in:
parent
d4139ee575
commit
62b0bcde8b
2 changed files with 9 additions and 5 deletions
|
@ -2,9 +2,13 @@ import React from 'react';
|
||||||
import './SoundChangeSuite.scss';
|
import './SoundChangeSuite.scss';
|
||||||
|
|
||||||
const SoundChangeSuite = props => {
|
const SoundChangeSuite = props => {
|
||||||
|
let epochName = props.epoch ? Object.keys(props.epoch)[0] : 'Changes';
|
||||||
return (
|
return (
|
||||||
<div className="SoundChangeSuite" data-testid="SoundChangeSuite">
|
<div className="SoundChangeSuite" data-testid={`${epochName}_SoundChangeSuite`}>
|
||||||
<h4>{props.epoch ? Object.keys(props.epoch)[0] : 'Changes'}</h4>
|
<h4>{epochName}</h4>
|
||||||
|
<form className="SoundChangeSuite__form" data-testid={`${epochName}_SoundChangeSuite_changes`}>
|
||||||
|
<textarea name="changes" id="" cols="30" rows="10" value={props.epoch ? props.epoch[epochName][0] : ''} onChange={e=>e.target.value}></textarea>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,11 @@ it('renders SoundChangeSuite without crashing', () => {
|
||||||
describe('SoundChangeSuite', () => {
|
describe('SoundChangeSuite', () => {
|
||||||
it('renders the correct subtitle', () => {
|
it('renders the correct subtitle', () => {
|
||||||
const { getByTestId } = render(<SoundChangeSuite epoch={{'Epoch Name': ['sound change rule']}}/>);
|
const { getByTestId } = render(<SoundChangeSuite epoch={{'Epoch Name': ['sound change rule']}}/>);
|
||||||
expect(getByTestId('SoundChangeSuite')).toHaveTextContent('Epoch Name');
|
expect(getByTestId('Epoch Name_SoundChangeSuite')).toHaveTextContent('Epoch Name');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders a suite of soundchanges', () => {
|
it('renders a suite of soundchanges', () => {
|
||||||
const { getByTestId } = render(<SoundChangeSuite />);
|
const { getByTestId } = render(<SoundChangeSuite epoch={{'Epoch Name': ['sound>change/environment']}}/>);
|
||||||
|
expect(getByTestId('Epoch Name_SoundChangeSuite_changes')).toHaveFormValues({changes: 'sound>change/environment'})
|
||||||
})
|
})
|
||||||
});
|
});
|
Loading…
Reference in a new issue