feat(Dropdown): add clear input key binding (#4002)

This commit is contained in:
Paul Thiel 2023-08-18 03:44:28 +02:00 committed by GitHub
parent 7529764482
commit dd74bcd821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -89,6 +89,14 @@ describe('clear checks', () => {
it('should have correct icon', () => {
expect(wrapper.find('.p-dropdown-clear-icon').classes()).toContain('pi-discord');
});
it('should clear with delete key', async () => {
const updateModelSpy = vi.spyOn(wrapper.vm, 'updateModel');
await wrapper.find('.p-dropdown-label.p-inputtext').trigger('keydown', { code: 'Delete' });
expect(updateModelSpy).toHaveBeenCalledOnce();
expect(updateModelSpy).toHaveBeenCalledWith(expect.any(KeyboardEvent), null);
});
});
describe('editable checks', () => {