Skip to content

Commit

Permalink
test: improve testing of noUiSlider
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Bijaoui committed Aug 24, 2016
1 parent c169cb3 commit 42c9ea9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unit/specs/fields/fieldNoUiSlider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,25 @@ describe("fieldNoUiSlider.vue", () => {
expect(input).to.be.defined;
expect(input.classList.contains("slider")).to.be.true;
});

before( () => {
vm.$appendTo(document.body);
});

it("should only test in the correct environment", (done) => {
if (window.noUiSlider) {
// make assertions
it("should contain a complex div element", (done) => {
vm.$nextTick( () => {
expect(input).to.be.defined;
expect(input.classList.contains("noui-target")).to.be.true;
done();
});
});

} else {
this.skip();
}
});
});
});

0 comments on commit 42c9ea9

Please sign in to comment.