Skip to content

Commit 09a41f0

Browse files
author
Lionel Bijaoui
committed
test: improve testing of VueMultiSelect
1 parent 4c7c717 commit 09a41f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ describe("fieldVueMultiSelect.vue", () => {
4949
});
5050

5151
it("should contain option elements", () => {
52-
let options = input.querySelectorAll("li.multiselect__option");
53-
console.log(options);
52+
let options = input.querySelectorAll("li.multiselect__option");
5453
expect(options.length).to.be.equal(schema.values.length);
5554
expect(options[1].querySelector("span").textContent).to.be.equal("Paris");
5655
expect(options[1].classList.contains("multiselect__option--selected")).to.be.true;
@@ -68,6 +67,7 @@ describe("fieldVueMultiSelect.vue", () => {
6867
it("input value should be the model value after changed", (done) => {
6968
model.city = "Rome";
7069
vm.$nextTick( () => {
70+
expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(1);
7171
let options = input.querySelectorAll("li.multiselect__option");
7272
expect(options[2].querySelector("span").textContent).to.be.equal("Rome");
7373
expect(options[2].classList.contains("multiselect__option--selected")).to.be.true;
@@ -78,6 +78,7 @@ describe("fieldVueMultiSelect.vue", () => {
7878
it("input value should be the model value after changed (multiselection)", (done) => {
7979
model.city = ["Paris","Rome"];
8080
vm.$nextTick( () => {
81+
expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(2);
8182
let options = input.querySelectorAll("li.multiselect__option");
8283
expect(options[1].querySelector("span").textContent).to.be.equal("Paris");
8384
expect(options[1].classList.contains("multiselect__option--selected")).to.be.true;
@@ -92,6 +93,7 @@ describe("fieldVueMultiSelect.vue", () => {
9293
trigger(options[2], "mousedown");
9394

9495
vm.$nextTick( () => {
96+
expect(model.city.length).to.be.equal(1);
9597
expect(model.city[0]).to.be.equal("Paris");
9698
done();
9799
});

0 commit comments

Comments
 (0)