mercredi 14 novembre 2018

Compared values have no visual difference when testing a prop of component

I have this code:

import Icon from "./icon.svg";

it("should have a prop space", () => {
    const tree = shallow(
      <Button name="button test" space={Icon} />
    );
    expect(tree.props().space).toEqual(<span>{Icon} </span>);
  });

When I run it, I take this as an answer:

Expected value to equal:

   <span>test-file-stub </span>

Received:

 <span>test-file-stub </span> 

Difference: Compared values have no visual difference.

What am I missing?

Aucun commentaire:

Enregistrer un commentaire