Closed jwmann closed 6 years ago
Merging #113 into master will decrease coverage by
0.39%
. The diff coverage is0%
.
@@ Coverage Diff @@
## master #113 +/- ##
=========================================
- Coverage 40.97% 40.57% -0.4%
=========================================
Files 6 6
Lines 205 207 +2
=========================================
Hits 84 84
- Misses 121 123 +2
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 2782171...f146b4b. Read the comment docs.
I'm trying to write some tests for this but it seems almost impossible.
describe('menuSelectionCallback', () => {
it('should return updatedValues', () => {
const wrapper = shallowWithContext(<SuperSelectField showAutocompleteThreshold="always">{testChildren}</SuperSelectField>)
wrapper.simulate('click')
const firstChild = wrapper.find('ListItem').first()
firstChild.simulate('click', {
preventDefault: () => {
},
});
expect( wrapper.instance().props.menuSelectionCallback ).toHaveBeenCalled()
})
})
Keep getting an error
TypeError: Cannot read property 'focus' of undefined
or undefined is not an object (evaluating '_this.root.focus')
I also just noticed #23 I didn't realize this was a hot button issue. I do think setting the state based onClick rather than when the menu is closed is necessary. Not only that, but the original docs were actually incorrect as it said the state was change onClick but that's not the case with onChange.
Unfortunately because of #105 I can't even run this on my project without published merges. I'm open to discussing these changes as well as test coverage. Hopefully we can resolve this without breaking any backwards compatibility.
solved with #119
Fixes #112