diff --git a/packages/input-amount/test/lion-input-amount.test.js b/packages/input-amount/test/lion-input-amount.test.js index 27cae4065..effc607f6 100644 --- a/packages/input-amount/test/lion-input-amount.test.js +++ b/packages/input-amount/test/lion-input-amount.test.js @@ -230,6 +230,28 @@ describe('', () => { expect(currLabel?.getAttribute('aria-label')).to.equal('euros'); }); + it('sets currency label on the after after element', async () => { + const el = /** @type {LionInputAmount} */ ( + await fixture(` + + Currency, please + `) + ); + const mySlotLabel = /** @type {HTMLElement[]} */ (Array.from(el.children)).find( + child => child.slot === 'after', + ); + expect(mySlotLabel?.id).to.equal('123'); + + el.currency = 'EUR'; + await el.updateComplete; + const currLabel = /** @type {HTMLElement[]} */ (Array.from(el.children)).find( + child => child.slot === 'after', + ); + expect(currLabel).to.equal(mySlotLabel); + expect(currLabel?.id).to.equal('123'); + expect(currLabel?.innerText).to.equal('EUR'); + }); + describe('Accessibility', () => { it('is accessible', async () => { const el = await fixture(