Skip to content

Commit 97d82db

Browse files
committed
add typing and pasting test
1 parent 3853ee7 commit 97d82db

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/react-aria-components/test/NumberField.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,19 @@ describe('NumberField', () => {
189189
expect(input).not.toHaveAttribute('aria-describedby');
190190
expect(numberfield).not.toHaveAttribute('data-invalid');
191191
});
192+
193+
it('should not type the grouping characters when useGrouping is false', async () => {
194+
let {getByRole} = render(<TestNumberField formatOptions={{useGrouping: false}} />);
195+
let input = getByRole('textbox');
196+
197+
await user.keyboard('102,4');
198+
expect(input).toHaveAttribute('value', '1024');
199+
200+
await user.clear(input);
201+
expect(input).toHaveAttribute('value', '');
202+
203+
await user.paste('102,4');
204+
await user.tab();
205+
expect(input).toHaveAttribute('value', '1024');
206+
});
192207
});

0 commit comments

Comments
 (0)