Components update v.3.21.0

This commit is contained in:
Bahadır Sofuoğlu 2022-12-08 14:04:25 +03:00
parent 18497d55b1
commit defd6ff6e2
242 changed files with 28022 additions and 17523 deletions

View file

@ -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');
});
});
});
});