qunit-dom
qunit-dom copied to clipboard
Add `hasChild` method to assert that child element exists
A hasChild
method would be helpful to assert that a child element exists.
Currently I find myself writing something like this from time to time:
assert
.dom('foo')
.hasText('...', 'renders text');
assert
.dom('foo .bar')
.exists('renders expected child element');
For readability it would be great if I could do this instead:
assert
.dom('foo')
.hasText('...', 'renders text')
.hasChild('.bar', 'renders expected child element');
This may be addressed by #1579 as well. But I think hasChild
would be more handy for simple cases, in which you only want to assert that a child element exists.