FIX feature & tests

This commit is contained in:
Norbert de Langen 2018-10-23 15:04:35 +02:00
parent 1eadde2319
commit 1fdfe33cdd
No known key found for this signature in database
GPG Key ID: 976651DA156C2825
2 changed files with 5 additions and 6 deletions

View File

@ -76,8 +76,8 @@ class TextFilter extends React.Component {
return ( return (
<Wrapper> <Wrapper>
<Input <Input
autocomplete="off" autoComplete="off"
spellcheck="false" spellCheck="false"
type="text" type="text"
placeholder="Filter" placeholder="Filter"
name="filter-text" name="filter-text"

View File

@ -8,15 +8,14 @@ describe('manager.ui.components.stories_panel.test_filter', () => {
describe('render', () => { describe('render', () => {
test('should render input without filterText', () => { test('should render input without filterText', () => {
const wrap = mount(<TextFilter />); const wrap = mount(<TextFilter />);
const input = wrap.find('[name="filter-text"]').first();
const input = wrap.find('Styled(input)').first();
expect(input).toHaveProp('placeholder', 'Filter'); expect(input).toHaveProp('placeholder', 'Filter');
}); });
test('should render input with filterText', () => { test('should render input with filterText', () => {
const wrap = mount(<TextFilter text="Filter Text" />); const wrap = mount(<TextFilter text="Filter Text" />);
const input = wrap.find('Styled(input)').first(); const input = wrap.find('[name="filter-text"]').first();
expect(input).toHaveProp('value', 'Filter Text'); expect(input).toHaveProp('value', 'Filter Text');
}); });
@ -27,7 +26,7 @@ describe('manager.ui.components.stories_panel.test_filter', () => {
const onChange = jest.fn(); const onChange = jest.fn();
const wrap = mount(<TextFilter onChange={onChange} />); const wrap = mount(<TextFilter onChange={onChange} />);
const input = wrap.find('Styled(input)').first(); const input = wrap.find('[name="filter-text"]').first();
input.value = 'new value'; input.value = 'new value';
input.simulate('change', { target: input }); input.simulate('change', { target: input });