mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Add 'filter'-event to Tree.vue
This commit is contained in:
parent
1100647eee
commit
2603b7a140
3 changed files with 38 additions and 4 deletions
|
@ -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();
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue