diff --git a/src/fields/fieldVueMultiSelect.vue b/src/fields/fieldVueMultiSelect.vue index 69924b0a..265f2559 100644 --- a/src/fields/fieldVueMultiSelect.vue +++ b/src/fields/fieldVueMultiSelect.vue @@ -4,7 +4,7 @@ :options="options", :multiple="schema.multiSelect", :value="value", - :key="selectOptions.key || null", + :track-by="selectOptions.trackBy || null", :label="selectOptions.label || null", :searchable="selectOptions.searchable", :local-search="selectOptions.localSearch", diff --git a/test/unit/karma.conf.js b/test/unit/karma.conf.js index 7fd1b13f..7bc16ab2 100644 --- a/test/unit/karma.conf.js +++ b/test/unit/karma.conf.js @@ -20,7 +20,7 @@ module.exports = function(config) { "https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.js", "https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.js", "https://cdnjs.cloudflare.com/ajax/libs/ion-rangeslider/2.1.4/js/ion.rangeSlider.js", - "https://rawgit.com/monterail/vue-multiselect/v1.1.4/lib/vue-multiselect.min.js", + "https://unpkg.com/vue-multiselect@2.0.0-beta.13", "https://rawgit.com/nosir/cleave.js/master/dist/cleave.js", "https://nosir.github.io/cleave.js/lib/cleave-phone.i18n.js", "https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/8.5.1/nouislider.js", diff --git a/test/unit/specs/fields/fieldVueMultiSelect.spec.js b/test/unit/specs/fields/fieldVueMultiSelect.spec.js index c1994305..8916b911 100644 --- a/test/unit/specs/fields/fieldVueMultiSelect.spec.js +++ b/test/unit/specs/fields/fieldVueMultiSelect.spec.js @@ -13,7 +13,7 @@ function createField(test, schema = {}, model = null, disabled = false, options) [ el, vm, field ] = createVueField(test, "fieldVueMultiSelect", schema, model, disabled, options); } -describe.skip("fieldVueMultiSelect.vue", function() { +describe("fieldVueMultiSelect.vue", function() { describe("check template", () => { let schema = { @@ -48,7 +48,7 @@ describe.skip("fieldVueMultiSelect.vue", function() { }); it("should contain option elements", () => { - let options = input.querySelectorAll("li.multiselect__option"); + let options = input.querySelectorAll("li.multiselect__element .multiselect__option"); expect(options.length).to.be.equal(schema.values.length); expect(options[1].querySelector("span").textContent).to.be.equal("Paris"); expect(options[1].classList.contains("multiselect__option--selected")).to.be.true; @@ -66,8 +66,8 @@ describe.skip("fieldVueMultiSelect.vue", function() { it("input value should be the model value after changed", (done) => { model.city = "Rome"; vm.$nextTick( () => { - expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(1); - let options = input.querySelectorAll("li.multiselect__option"); + expect(input.querySelectorAll("li .multiselect__option--selected").length).to.be.equal(1); + let options = input.querySelectorAll("li .multiselect__option"); expect(options[2].querySelector("span").textContent).to.be.equal("Rome"); expect(options[2].classList.contains("multiselect__option--selected")).to.be.true; done(); @@ -77,8 +77,8 @@ describe.skip("fieldVueMultiSelect.vue", function() { it("input value should be the model value after changed (multiselection)", (done) => { model.city = ["Paris","Rome"]; vm.$nextTick( () => { - expect(input.querySelectorAll("li.multiselect__option--selected").length).to.be.equal(2); - let options = input.querySelectorAll("li.multiselect__option"); + expect(input.querySelectorAll("li .multiselect__option--selected").length).to.be.equal(2); + let options = input.querySelectorAll("li .multiselect__option"); expect(options[1].querySelector("span").textContent).to.be.equal("Paris"); expect(options[1].classList.contains("multiselect__option--selected")).to.be.true; expect(options[2].querySelector("span").textContent).to.be.equal("Rome"); @@ -88,7 +88,7 @@ describe.skip("fieldVueMultiSelect.vue", function() { }); it("model value should be the input value if changed", (done) => { - let options = input.querySelectorAll("li.multiselect__option"); + let options = input.querySelectorAll("li .multiselect__option"); trigger(options[2], "mousedown"); vm.$nextTick( () => {