From b4d2b34be1665cb647088f75ef8cf7b907259519 Mon Sep 17 00:00:00 2001 From: Lionel Bijaoui Date: Wed, 21 Jun 2017 12:04:48 +0200 Subject: [PATCH] Add an option to hide the none selected text --- src/fields/core/fieldSelect.vue | 2 +- test/unit/specs/fields/fieldSelect.spec.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/fields/core/fieldSelect.vue b/src/fields/core/fieldSelect.vue index 3288a1b4..fed5e4c3 100644 --- a/src/fields/core/fieldSelect.vue +++ b/src/fields/core/fieldSelect.vue @@ -1,6 +1,6 @@ diff --git a/test/unit/specs/fields/fieldSelect.spec.js b/test/unit/specs/fields/fieldSelect.spec.js index ee125dbe..2755dc81 100644 --- a/test/unit/specs/fields/fieldSelect.spec.js +++ b/test/unit/specs/fields/fieldSelect.spec.js @@ -121,6 +121,22 @@ describe("fieldSelect.vue", function() { }); }); + it("should hide the customized text", (done) => { + Vue.set(vm.schema, "selectOptions", { + noneSelectedText: "Empty list", + hideNoneSelectedText: true + }); + vm.$nextTick( () => { + let options = input.querySelectorAll("option"); + expect(options[0].disabled).to.be.false; + expect(options[0].textContent).to.not.be.equal("Empty list"); + + schema.selectOptions = null; + + done(); + }); + }); + }); describe("check static values with { id, name } objects", () => {