Git Product home page Git Product logo

Comments (13)

FezVrasta avatar FezVrasta commented on May 21, 2024 3

It works ❤️

from enzyme-to-json.

adriantoine avatar adriantoine commented on May 21, 2024 1

@FezVrasta v3.1.3 is out!

from enzyme-to-json.

FezVrasta avatar FezVrasta commented on May 21, 2024 1

Thank you!

from enzyme-to-json.

adriantoine avatar adriantoine commented on May 21, 2024

Hi @ShaneDrury!

As you say I'm checking for null and undefined values, but not all falsy values. Although it seems weird that it give

exports[`falsey case 1`] = `undefined`;

it should give

exports[`falsey case 1`] = `false`;

I will have a look but I think I will stick to an empty string for null and undefined only as you might want to see if you component returns false sometimes.

from enzyme-to-json.

FezVrasta avatar FezVrasta commented on May 21, 2024

I'm still reproducing something similar (or the same?) with 3.1.2

<div styleName="CarouselDot__inner">
  {!!icon && <Icon styleName="CarouselDot__icon" name={icon} />}
</div>

When icon is evaluated as false the snapshot will read:

<div
  className="CarouselDot__inner"
>
  <undefined />
</div>

If I change it to {icon ? <Icon styleName="CarouselDot__icon" name={icon} /> : null} it works properly.

The weird thing is that my whole project makes use of renders of this kind, and only this component gives me this problem.

Ideas?

from enzyme-to-json.

adriantoine avatar adriantoine commented on May 21, 2024

Hey @FezVrasta, that's my bad, I haven't released a new version including the fix. I'll get v3.1.3 out asap.

from enzyme-to-json.

FezVrasta avatar FezVrasta commented on May 21, 2024

Nope, no way... I'm getting the same problem of before even with 3.1.3... I double checked it 😓

Note that my component doesn't return just false, it returns something like: <div>{false}</div>

from enzyme-to-json.

adriantoine avatar adriantoine commented on May 21, 2024

@FezVrasta I will have a look now.

from enzyme-to-json.

FezVrasta avatar FezVrasta commented on May 21, 2024

I'm going to send a PR to add a failing test, if I manage to get one.

from enzyme-to-json.

adriantoine avatar adriantoine commented on May 21, 2024

Don't worry I just reproduced the issue so I have a failing test.

Thanks for reporting the issue by the way.

from enzyme-to-json.

FezVrasta avatar FezVrasta commented on May 21, 2024

Oh, I just finished the PR lol.

nevermind then 😇

from enzyme-to-json.

adriantoine avatar adriantoine commented on May 21, 2024

Haha sorry, good news is that I fixed it already.

from enzyme-to-json.

adriantoine avatar adriantoine commented on May 21, 2024

@FezVrasta it should be fixed in v3.1.4 🎉

from enzyme-to-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.