From 2740f17605360d474042da66eaf72783579471f2 Mon Sep 17 00:00:00 2001 From: JaySunSyn Date: Tue, 16 Jul 2019 13:41:07 +0200 Subject: [PATCH] fix(input): delegate "step" attribute --- packages/input/src/LionInput.js | 8 ++++++++ packages/input/test/lion-input.test.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/input/src/LionInput.js b/packages/input/src/LionInput.js index 2552c9bdd..31b9905b9 100644 --- a/packages/input/src/LionInput.js +++ b/packages/input/src/LionInput.js @@ -25,6 +25,14 @@ export class LionInput extends LionField { }; } + get delegations() { + return { + ...super.delegations, + properties: [...super.delegations.properties, 'step'], + attributes: [...super.delegations.attributes, 'step'], + }; + } + get slots() { return { ...super.slots, diff --git a/packages/input/test/lion-input.test.js b/packages/input/test/lion-input.test.js index 01cdbb599..c144f4517 100644 --- a/packages/input/test/lion-input.test.js +++ b/packages/input/test/lion-input.test.js @@ -14,6 +14,14 @@ describe('', () => { expect(el.inputElement.readOnly).to.equal(false); }); + it('delegates "step" attribute and property', async () => { + const el = await fixture(``); + expect(el.inputElement.step).to.equal('0.01'); + // TODO: activate when DelegateMixin is refactored + // const el2 = await fixture(``); + // expect(el2.inputElement.step).to.equal('0.02'); + }); + it('automatically creates an element if not provided by user', async () => { const el = await fixture(``); expect(el.querySelector('input')).to.equal(el.inputElement);