Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
ember-chai-dom-helpers
Advanced tools
A set of Chai assertions ready for your DOM.
$ ember install ember-chai-dom-helpers
In your /tests/test-helper.js
file, simply add :
import setupChaiDomHelpers from 'ember-chai-dom-helpers/test-support/setup';
setupChaiDomHelpers();
The assertion subject have to be one of the following:
Here's the helpers availables:
Test if the specified subject exists.
expect('.something').to.be.rendered;
expect('.something').to.be.not.rendered;
Test the plain text content of the subject.
expect('.something').to.have.textContent('foobar');
expect('.something').to.not.have.textContent('foobar');
Test the html content of the subject.
expect('.something').to.have.htmlContent('<div>foobar</div>');
expect('.something').to.not.have.htmlContent('<div>foobar</div>');
Test the number of elements that matches the subject.
expect('.something').to.have.count(1);
expect('.something').to.not.have.count(1);
Test if the subject have a given class.
expect('.something').to.have.class('active');
expect('.something').to.not.have.class('active');
It is also possible to test ember-css-module local classes.
expect('.something').to.have.localClass('active'); // would match the class '_active_q1w2e3'
expect('.something').to.not.have.localClass('active');
Test if the subject have a specific style value.
expect('.something').to.have.style('color', 'hotpink');
expect('.something').to.not.have.style('color', 'hotpink');
expect('.something').to.be.disabled;
expect('.something').to.be.not.disabled;
Test if the subject have a specific attribute value.
expect('.something').to.have.attribute('alt', 'foobar');
expect('.something').to.not.have.attribute('alt', 'foobar');
Test the subject's value.
expect('.something').to.have.value('foobar');
expect('.something').to.not.have.value('foobar');
ember-chai-dom-helpers
is © 2019 Mirego and may be freely distributed under the New BSD license.
See the LICENSE.md
file.
The cup logo is based on this lovely icon by MHD AZMI DWIPRANATA, from The Noun Project. Used under a Creative Commons BY 3.0 license.
Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We're a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.
We also love open-source software and we try to give back to the community as much as we can.
FAQs
A set of Chai helpers ready for your DOM.
The npm package ember-chai-dom-helpers receives a total of 0 weekly downloads. As such, ember-chai-dom-helpers popularity was classified as not popular.
We found that ember-chai-dom-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.