Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(textfilter): turn off spell check in story filter #4472

Merged
merged 5 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ exports[`Storyshots UI|stories/StoriesPanel default 1`] = `
class="css-79elbk eg9vth70"
>
<input
autocomplete="off"
class="css-1yhj4t5 eg9vth71"
name="filter-text"
placeholder="Filter"
spellcheck="false"
type="text"
value=""
/>
Expand Down Expand Up @@ -56,9 +58,11 @@ exports[`Storyshots UI|stories/StoriesPanel storiesHierarchies exists but is emp
class="css-79elbk eg9vth70"
>
<input
autocomplete="off"
class="css-1yhj4t5 eg9vth71"
name="filter-text"
placeholder="Filter"
spellcheck="false"
type="text"
value=""
/>
Expand Down Expand Up @@ -89,9 +93,11 @@ exports[`Storyshots UI|stories/StoriesPanel when open on mobile device 1`] = `
class="css-79elbk eg9vth70"
>
<input
autocomplete="off"
class="css-1yhj4t5 eg9vth71"
name="filter-text"
placeholder="Filter"
spellcheck="false"
type="text"
value=""
/>
Expand Down Expand Up @@ -122,9 +128,11 @@ exports[`Storyshots UI|stories/StoriesPanel with storiesHierarchies prop 1`] = `
class="css-79elbk eg9vth70"
>
<input
autocomplete="off"
class="css-1yhj4t5 eg9vth71"
name="filter-text"
placeholder="Filter"
spellcheck="false"
type="text"
value=""
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ exports[`Storyshots UI|stories/TextFilter with filterText 1`] = `
class="css-79elbk eg9vth70"
>
<input
autocomplete="off"
class="css-1yhj4t5 eg9vth71"
name="filter-text"
placeholder="Filter"
spellcheck="false"
type="text"
value="Filter Text"
/>
Expand All @@ -24,9 +26,11 @@ exports[`Storyshots UI|stories/TextFilter without filterText 1`] = `
class="css-79elbk eg9vth70"
>
<input
autocomplete="off"
class="css-1yhj4t5 eg9vth71"
name="filter-text"
placeholder="Filter"
spellcheck="false"
type="text"
value=""
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class TextFilter extends React.Component {
return (
<Wrapper>
<Input
autoComplete="off"
spellCheck="false"
type="text"
placeholder="Filter"
name="filter-text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ describe('manager.ui.components.stories_panel.test_filter', () => {
describe('render', () => {
test('should render input without filterText', () => {
const wrap = mount(<TextFilter />);

const input = wrap.find('Styled(input)').first();
const input = wrap.find('[name="filter-text"]').first();

expect(input).toHaveProp('placeholder', 'Filter');
});

test('should render input with filterText', () => {
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');
});
Expand All @@ -27,7 +26,7 @@ describe('manager.ui.components.stories_panel.test_filter', () => {
const onChange = jest.fn();
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.simulate('change', { target: input });

Expand Down