Giter Site home page Giter Site logo

Comments (10)

antsmartian avatar antsmartian commented on May 13, 2024 2

@gnapse I can give it a shot on this, if I get some time tomorrow.

from jest-dom.

antsmartian avatar antsmartian commented on May 13, 2024 1

@gnapse Sorry was busy.. Yeah should be able to close this when I get time :)

from jest-dom.

kentcdodds avatar kentcdodds commented on May 13, 2024

I'm in favor of all three of these matchers, especially these two:

expect(container).toContainElement(element)
expect(element).toBeInTheDOM(container)

👍

from jest-dom.

gnapse avatar gnapse commented on May 13, 2024

But .toBeInTheDOM receiving the container optionally, or always? I assume the former, so it does not become a breaking change, right?

from jest-dom.

kentcdodds avatar kentcdodds commented on May 13, 2024

Yes, it would be optional 👍

from jest-dom.

gnapse avatar gnapse commented on May 13, 2024

Ok, I should have time to work on some of these later this week, but if someone else can give it a crack, go for it.

(Maybe @sompylasar, since he originally reported it and was needing it?)

from jest-dom.

gnapse avatar gnapse commented on May 13, 2024

BTW, I'd rule this out for the time being:

expect(element).toBeAChildOf(parent)

As its name suggest, it'd be checking only for a direct parent-child relationship between two nodes. This is not as useful and it's a bit more brittle than checking a more general ancestry relationship. After all, users on the screen do not really know about direct relationships. They generally care about seeing some elements inside others, and that's what .toContainElement expressed already.

from jest-dom.

gnapse avatar gnapse commented on May 13, 2024

@antoaravinth are you still up to get this?

from jest-dom.

gnapse avatar gnapse commented on May 13, 2024

Sure, no problem and no hurries, just wanted to check if your offer was still on.

from jest-dom.

gnapse avatar gnapse commented on May 13, 2024

Closing as this was solved in #25

from jest-dom.

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.