Skip to content

Commit 2aacb57

Browse files
committed
fix vue-multiselect test errors
1 parent 593307b commit 2aacb57

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/fields/fieldVueMultiSelect.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:options="options",
55
:multiple="schema.multiSelect",
66
:value="value",
7-
:key="selectOptions.key || null",
7+
:track-by="selectOptions.trackBy || null",
88
:label="selectOptions.label || null",
99
:searchable="selectOptions.searchable",
1010
:local-search="selectOptions.localSearch",

test/unit/karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function(config) {
2020
"https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.js",
2121
"https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.js",
2222
"https://cdnjs.cloudflare.com/ajax/libs/ion-rangeslider/2.1.4/js/ion.rangeSlider.js",
23-
"https://rawgit.com/monterail/vue-multiselect/v1.1.4/lib/vue-multiselect.min.js",
23+
"https://unpkg.com/vue-multiselect@2.0.0-beta.13",
2424
"https://rawgit.com/nosir/cleave.js/master/dist/cleave.js",
2525
"https://nosir.github.io/cleave.js/lib/cleave-phone.i18n.js",
2626
"https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/8.5.1/nouislider.js",

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function createField(test, schema = {}, model = null, disabled = false, options)
1313
[ el, vm, field ] = createVueField(test, "fieldVueMultiSelect", schema, model, disabled, options);
1414
}
1515

16-
describe.skip("fieldVueMultiSelect.vue", function() {
16+
describe("fieldVueMultiSelect.vue", function() {
1717

1818
describe("check template", () => {
1919
let schema = {
@@ -48,7 +48,7 @@ describe.skip("fieldVueMultiSelect.vue", function() {
4848
});
4949

5050
it("should contain option elements", () => {
51-
let options = input.querySelectorAll("li.multiselect__option");
51+
let options = input.querySelectorAll("li.multiselect__element .multiselect__option");
5252
expect(options.length).to.be.equal(schema.values.length);
5353
expect(options[1].querySelector("span").textContent).to.be.equal("Paris");
5454
expect(options[1].classList.contains("multiselect__option--selected")).to.be.true;
@@ -66,8 +66,8 @@ describe.skip("fieldVueMultiSelect.vue", function() {
6666
it("input value should be the model value after changed", (done) => {
6767
model.city = "Rome";
6868
vm.$nextTick( () => {
69-
expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(1);
70-
let options = input.querySelectorAll("li.multiselect__option");
69+
expect(input.querySelectorAll("li .multiselect__option--selected").length).to.be.equal(1);
70+
let options = input.querySelectorAll("li .multiselect__option");
7171
expect(options[2].querySelector("span").textContent).to.be.equal("Rome");
7272
expect(options[2].classList.contains("multiselect__option--selected")).to.be.true;
7373
done();
@@ -77,8 +77,8 @@ describe.skip("fieldVueMultiSelect.vue", function() {
7777
it("input value should be the model value after changed (multiselection)", (done) => {
7878
model.city = ["Paris","Rome"];
7979
vm.$nextTick( () => {
80-
expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(2);
81-
let options = input.querySelectorAll("li.multiselect__option");
80+
expect(input.querySelectorAll("li .multiselect__option--selected").length).to.be.equal(2);
81+
let options = input.querySelectorAll("li .multiselect__option");
8282
expect(options[1].querySelector("span").textContent).to.be.equal("Paris");
8383
expect(options[1].classList.contains("multiselect__option--selected")).to.be.true;
8484
expect(options[2].querySelector("span").textContent).to.be.equal("Rome");
@@ -88,7 +88,7 @@ describe.skip("fieldVueMultiSelect.vue", function() {
8888
});
8989

9090
it("model value should be the input value if changed", (done) => {
91-
let options = input.querySelectorAll("li.multiselect__option");
91+
let options = input.querySelectorAll("li .multiselect__option");
9292
trigger(options[2], "mousedown");
9393

9494
vm.$nextTick( () => {

0 commit comments

Comments
 (0)