Add 'filter'-event to Tree.vue

This commit is contained in:
Maximilian Röttgen 2023-11-23 16:48:14 +01:00
parent 1100647eee
commit 2603b7a140
3 changed files with 38 additions and 4 deletions

View file

@ -1,6 +1,4 @@
import { mount } from '@vue/test-utils';
import PrimeVue from 'primevue/config';
import { nextTick } from 'vue';
import Tree from './Tree.vue';
describe('Tree.vue', () => {
@ -42,4 +40,18 @@ describe('Tree.vue', () => {
expect(wrapper.emitted('keydown')).toBeFalsy();
});
it('emits update:filterValue on filter input', async () => {
wrapper = mount(Tree, {
props: {
filter: true,
},
});
let searchField = wrapper.find('input.p-tree-filter');
await searchField.trigger('keydown.space');
expect(wrapper.emitted('filter')).toBeTruthy();
})
});