Shallow(<SomeComponent />).is(SomeComponent) returns false
Open
API: mount
bug
help wanted
- Dominant language
- JavaScript
- Stars
- 19.8k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
Basically, this fails:
```
it('should be true', () => {
const SomeComponent = () => (
expect(shallow().is(SomeComponent)).to.be.true;
});
```
while this works:
```
// require('jsdom')...
it('should be true', () => {
const SomeComponent = () => (
expect(mount().is(SomeComponent)).to.be.true;
});
```
Am I wrong to assume the first one should work too?
Contributor guide
Research direction
Start by reproducing the shallow() and mount() examples from the issue and trace the implementation of the is() assertion for shallow wrappers. Compare the two behaviors and add a regression test demonstrating that shallow().is(SomeComponent) returns true when the intended behavior is confirmed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100