diff --git a/packages/radix-vue/src/PinInput/PinInput.test.ts b/packages/radix-vue/src/PinInput/PinInput.test.ts index 9e5ff6b7a..76ab91204 100644 --- a/packages/radix-vue/src/PinInput/PinInput.test.ts +++ b/packages/radix-vue/src/PinInput/PinInput.test.ts @@ -22,6 +22,14 @@ describe('given default PinInput', () => { expect(await axe(wrapper.element)).toHaveNoViolations() }) + it('should display input placeholders', () => { + expect(inputs[0].element.placeholder).toBe('') // first input was focused thus not showing placeholder + expect(inputs[1].element.placeholder).toBe('*') + expect(inputs[2].element.placeholder).toBe('*') + expect(inputs[3].element.placeholder).toBe('*') + expect(inputs[4].element.placeholder).toBe('*') + }) + describe('after user input', () => { beforeEach(async () => { await userEvent.keyboard('test') @@ -143,6 +151,22 @@ describe('given default PinInput', () => { it('should emit \'complete\' with the result', () => { expect(wrapper.emitted('complete')?.[0]?.[0]).toStrictEqual(['a', 'p', 'p', 'l', 'e']) }) + + describe('after resetting value', async () => { + beforeEach(async () => { + await userEvent.keyboard('apple') + const button = wrapper.find('button') + await button.trigger('click') + }) + + it('should display input placeholders', () => { + expect(inputs[0].element.placeholder).toBe('*') + expect(inputs[1].element.placeholder).toBe('*') + expect(inputs[2].element.placeholder).toBe('*') + expect(inputs[3].element.placeholder).toBe('*') + expect(inputs[4].element.placeholder).toBe('*') + }) + }) }) }) diff --git a/packages/radix-vue/src/PinInput/PinInputInput.vue b/packages/radix-vue/src/PinInput/PinInputInput.vue index 3aff8bdb9..3e3423c8b 100644 --- a/packages/radix-vue/src/PinInput/PinInputInput.vue +++ b/packages/radix-vue/src/PinInput/PinInputInput.vue @@ -12,7 +12,7 @@ export interface PinInputInputProps extends PrimitiveProps {