mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Components update v.3.21.0
This commit is contained in:
parent
18497d55b1
commit
defd6ff6e2
242 changed files with 28022 additions and 17523 deletions
|
@ -1,5 +1,6 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import PrimeVue from '../config/PrimeVue';
|
||||
import PrimeVue from 'primevue/config';
|
||||
import { nextTick } from 'vue';
|
||||
import AutoComplete from './AutoComplete.vue';
|
||||
|
||||
describe('AutoComplete.vue', () => {
|
||||
|
@ -37,7 +38,7 @@ describe('AutoComplete.vue', () => {
|
|||
expect(wrapper.find('.p-autocomplete-input').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('search copmlete', async () => {
|
||||
it('search complete', async () => {
|
||||
const event = { target: { value: 'b' } };
|
||||
|
||||
wrapper.vm.onInput(event);
|
||||
|
@ -53,4 +54,35 @@ describe('AutoComplete.vue', () => {
|
|||
expect(wrapper.find('.p-autocomplete-items').exists()).toBe(true);
|
||||
expect(wrapper.findAll('.p-autocomplete-item').length).toBe(1);
|
||||
});
|
||||
|
||||
describe('dropdown', () => {
|
||||
it('should have correct custom icon', async () => {
|
||||
wrapper.setProps({
|
||||
dropdown: true,
|
||||
dropdownIcon: 'pi pi-discord'
|
||||
});
|
||||
|
||||
await nextTick();
|
||||
|
||||
const token = wrapper.find('.p-button-icon');
|
||||
|
||||
expect(token.classes()).toContain('pi-discord');
|
||||
});
|
||||
});
|
||||
|
||||
describe('multiple', () => {
|
||||
it('should have correct custom icon', async () => {
|
||||
wrapper.setProps({
|
||||
multiple: true,
|
||||
removeTokenIcon: 'pi pi-discord',
|
||||
modelValue: ['foo', 'bar']
|
||||
});
|
||||
|
||||
await nextTick();
|
||||
|
||||
wrapper.findAll('.p-autocomplete-token-icon').forEach((tokenIcon) => {
|
||||
expect(tokenIcon.classes()).toContain('pi-discord');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue