diff --git a/src/fields/abstractField.js b/src/fields/abstractField.js index 6d253241..5e9ef26c 100644 --- a/src/fields/abstractField.js +++ b/src/fields/abstractField.js @@ -176,6 +176,10 @@ export default { return this.schema.fieldClasses || []; }, + getLabelClasses() { + return this.schema.labelClasses || []; + }, + formatValueToField(value) { return value; }, diff --git a/test/unit/specs/fields/abstractField.spec.js b/test/unit/specs/fields/abstractField.spec.js index a4fd6e82..89968a4e 100644 --- a/test/unit/specs/fields/abstractField.spec.js +++ b/test/unit/specs/fields/abstractField.spec.js @@ -503,4 +503,28 @@ describe("abstractField.vue", function() { }); + + describe("check classes application to labels", () => { + + let schema = { + type: "text", + label: "First Name", + model: "user__model", + inputName: "input_name", + labelClasses: ["applied-class", "another-class"] + }; + let model = {}; + + before( () => { + createField(this, schema, model); + }); + + it("should have 2 classes ('applied-class' and 'another-class')", () => { + expect(field.getLabelClasses().length).to.be.equal(2); + expect(field.getLabelClasses()[0]).to.be.equal("applied-class"); + expect(field.getLabelClasses()[1]).to.be.equal("another-class"); + }); + + }); + });