enzymejs/enzyme

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

Open

#768 geöffnet am 12. Jan. 2017

Auf GitHub ansehen
 (14 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (19.979 Stars) (2.016 Forks)batch import
API: mountbughelp wanted

Beschreibung

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?

Contributor Guide