Skip to content

Commit 42c9ea9

Browse files
author
Lionel Bijaoui
committed
test: improve testing of noUiSlider
1 parent c169cb3 commit 42c9ea9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/unit/specs/fields/fieldNoUiSlider.spec.js

+20
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,25 @@ describe("fieldNoUiSlider.vue", () => {
3838
expect(input).to.be.defined;
3939
expect(input.classList.contains("slider")).to.be.true;
4040
});
41+
42+
before( () => {
43+
vm.$appendTo(document.body);
44+
});
45+
46+
it("should only test in the correct environment", (done) => {
47+
if (window.noUiSlider) {
48+
// make assertions
49+
it("should contain a complex div element", (done) => {
50+
vm.$nextTick( () => {
51+
expect(input).to.be.defined;
52+
expect(input.classList.contains("noui-target")).to.be.true;
53+
done();
54+
});
55+
});
56+
57+
} else {
58+
this.skip();
59+
}
60+
});
4161
});
4262
});

0 commit comments

Comments
 (0)