Skip to content
Advertisement

Checking if multiple elements are rendering using jasmine

JavaScript
JavaScript

Greetings, I am trying to write a unit test where i can test if multiple divs are getting rendered which depend on a common condition. I want to know if there is a way to do it in one test rather than writing a test for each of them individually since they all dependent on a common condition. That is, either none of them appear or all of them should.

Advertisement

Answer

I think you can use queryAll instead of query. queryAll will return an array.

Try the following:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement