enzymejs/enzyme

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

Open

#768 aperta il 12 gen 2017

Vedi su GitHub
 (14 commenti) (0 reazioni) (0 assegnatari)JavaScript (2016 fork)batch import
API: mountbughelp wanted

Metriche repository

Star
 (19.979 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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?

Guida contributor