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

Refactor/update multiselect tests #5951

Merged
merged 38 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ed6085a
fix(Dropdown): rely on list-box height closes #4916
vpicone Dec 18, 2019
7a3b726
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Jan 7, 2020
e8c792d
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Jan 8, 2020
8efb0e8
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Jan 15, 2020
72dd222
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Feb 7, 2020
c541a9b
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Mar 3, 2020
39f7be3
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Mar 23, 2020
38ad34b
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Mar 24, 2020
9e2544d
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Apr 3, 2020
61a8e15
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Apr 3, 2020
6f5822e
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Apr 16, 2020
5450502
Merge branch 'master' of github.com:carbon-design-system/carbon
dakahn Apr 23, 2020
c9ed78a
test(multiselect): update tests to RTLish style
dakahn Apr 28, 2020
1f4fa79
Merge branch 'master' into refactor/update-multiselect-tests
joshblack Apr 28, 2020
b793e50
test(project): update snapshots
joshblack Apr 28, 2020
716e500
chore(tests): update snapshots
dakahn Apr 28, 2020
d17fdd7
Merge branch 'refactor/update-multiselect-tests' of github.com:dakahn…
dakahn Apr 28, 2020
fae2353
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 28, 2020
f1e8038
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 28, 2020
c8918a8
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 28, 2020
10a36f2
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 28, 2020
7b719c0
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 28, 2020
5c1b55a
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 28, 2020
7146ad8
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 28, 2020
970a632
fix(multiselect-test): remove unused import
dakahn Apr 28, 2020
39946e5
Merge branch 'refactor/update-multiselect-tests' of github.com:dakahn…
dakahn Apr 28, 2020
aedf877
test(FilterableMultiselect): remove checks against state
dakahn Apr 29, 2020
ea9787b
Merge branch 'master' into refactor/update-multiselect-tests
joshblack Apr 29, 2020
725f049
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 29, 2020
8672a1e
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 29, 2020
154c60c
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 29, 2020
3aa6674
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 29, 2020
4b3108f
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 29, 2020
74a1c32
Update packages/react/src/components/MultiSelect/__tests__/MultiSelec…
dakahn Apr 29, 2020
bc13c29
Merge branch 'master' into refactor/update-multiselect-tests
dakahn Apr 29, 2020
ede09c4
Merge branch 'master' into refactor/update-multiselect-tests
dakahn Apr 29, 2020
e0b267e
test(multiselect): fix undefined vars
dakahn Apr 29, 2020
9226e73
Merge branch 'master' into refactor/update-multiselect-tests
dakahn Apr 29, 2020
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 @@ -46,7 +46,14 @@ describe('MultiSelect.Filterable', () => {

it('should initially have the menu open when open prop is provided', () => {
const wrapper = mount(<MultiSelect.Filterable {...mockProps} open />);
expect(wrapper.state('isOpen')).toBe(true);
assertMenuOpen(wrapper, mockProps);
});

it('should open the menu with a down arrow', () => {
const wrapper = mount(<MultiSelect.Filterable {...mockProps} />);

findMenuIconNode(wrapper).simulate('keyDown', { key: 'ArrowDown' });
assertMenuOpen(wrapper, mockProps);
});

it('should let the user toggle the menu by the menu icon', () => {
Expand All @@ -71,7 +78,12 @@ describe('MultiSelect.Filterable', () => {
const wrapper = mount(<MultiSelect.Filterable {...mockProps} />);
openMenu(wrapper);
expect(wrapper.find(listItemName).length).toBe(mockProps.items.length);
wrapper.setState({ inputValue: '3' });

wrapper
.find('[role="combobox"]')
.at(0)
.simulate('change', { target: { value: '3' } });

expect(wrapper.find(listItemName).length).toBe(1);
});

Expand Down Expand Up @@ -154,12 +166,17 @@ describe('MultiSelect.Filterable', () => {
const wrapper = mount(<MultiSelect.Filterable {...mockProps} />);
const inputValue = 'Item';
openMenu(wrapper);
wrapper.setState({ inputValue });

wrapper
.find('[role="combobox"]')
.at(0)
.simulate('change', { target: { value: 'Item' } });

wrapper
.find(listItemName)
.at(0)
.simulate('click');

expect(wrapper.state('inputValue')).toEqual(inputValue);
expect(wrapper.find('[role="combobox"]').props().value).toEqual(inputValue);
});
});
Loading