enzymejs/enzyme

Shallow(<SomeComponent />).is(SomeComponent) returns false

Open

#768 ouverte le 12 janv. 2017

Voir sur GitHub
 (14 commentaires) (0 réactions) (0 assignés)JavaScript (19 979 stars) (2 016 forks)batch import
API: mountbughelp wanted

Description

Basically, this fails:

it('should be true', () => {
  const SomeComponent = () => (<div></div>);
  expect(shallow(<SomeComponent />).is(SomeComponent)).to.be.true;
});

while this works:

  // require('jsdom')...
  it('should be true', () => {
    const SomeComponent = () => (<div></div>);
    expect(mount(<SomeComponent />).is(SomeComponent)).to.be.true;
  });

Am I wrong to assume the first one should work too?

Guide contributeur