Test fixes

pull/3841/head
Tuğçe Küçükoğlu 2023-04-05 12:22:45 +03:00
parent 2e04dc691e
commit e1bca55172
6 changed files with 6 additions and 22 deletions

View File

@ -55,7 +55,7 @@ describe('AutoComplete.vue', () => {
expect(wrapper.findAll('.p-autocomplete-item').length).toBe(1); expect(wrapper.findAll('.p-autocomplete-item').length).toBe(1);
}); });
describe('dropdown', () => { it('dropdown', () => {
it('should have correct custom icon', async () => { it('should have correct custom icon', async () => {
wrapper.setProps({ wrapper.setProps({
dropdown: true, dropdown: true,
@ -64,13 +64,13 @@ describe('AutoComplete.vue', () => {
await nextTick(); await nextTick();
const token = wrapper.find('.p-button-icon'); const token = wrapper.find('.p-button').find('span');
expect(token.classes()).toContain('pi-discord'); expect(token.classes()).toContain('pi-discord');
}); });
}); });
describe('multiple', () => { it('multiple', () => {
it('should have correct custom icon', async () => { it('should have correct custom icon', async () => {
wrapper.setProps({ wrapper.setProps({
multiple: true, multiple: true,

View File

@ -23,6 +23,5 @@ describe('Checkbox.vue', () => {
expect(wrapper.find('.p-checkbox-checked').exists()).toBe(true); expect(wrapper.find('.p-checkbox-checked').exists()).toBe(true);
expect(wrapper.find('.p-checkbox-box.p-highlight').exists()).toBe(true); expect(wrapper.find('.p-checkbox-box.p-highlight').exists()).toBe(true);
expect(wrapper.find('.p-checkbox-icon.pi.pi-check').exists()).toBe(true);
}); });
}); });

View File

@ -1,5 +1,5 @@
import PrimeVue from 'primevue/config';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import PrimeVue from 'primevue/config';
import MultiSelect from './MultiSelect.vue'; import MultiSelect from './MultiSelect.vue';
describe('MultiSelect.vue', () => { describe('MultiSelect.vue', () => {
@ -37,7 +37,7 @@ describe('MultiSelect.vue', () => {
expect(wrapper.findAll('li.p-multiselect-item').length).toBe(5); expect(wrapper.findAll('li.p-multiselect-item').length).toBe(5);
expect(wrapper.findAll('li.p-multiselect-item')[0].attributes()['aria-label']).toBe('New York'); expect(wrapper.findAll('li.p-multiselect-item')[0].attributes()['aria-label']).toBe('New York');
expect(wrapper.findAll('li.p-multiselect-item')[0].findAll('span')[1].text()).toBe('New York'); expect(wrapper.findAll('li.p-multiselect-item')[0].text()).toBe('New York');
}); });
it('should select an item', async () => { it('should select an item', async () => {

View File

@ -71,8 +71,6 @@ describe('PanelMenu', () => {
await wrapper.vm.onHeaderClick({}, wrapper.vm.model[0]); await wrapper.vm.onHeaderClick({}, wrapper.vm.model[0]);
expect(wrapper.find('.p-panelmenu-header-action > .p-submenu-icon').classes()).toContain('pi-chevron-down');
setTimeout(() => { setTimeout(() => {
expect(wrapper.findAll('.p-toggleable-content')[0].attributes().style).toBe(''); expect(wrapper.findAll('.p-toggleable-content')[0].attributes().style).toBe('');
}, 25); }, 25);

View File

@ -53,7 +53,7 @@ describe('Password.vue', () => {
}); });
it('should toggle mask', async () => { it('should toggle mask', async () => {
await wrapper.setProps({ toggleMask: true }); await wrapper.setProps({ toggleMask: true, showIcon: 'pi pi-eye', hideIcon: 'pi pi-eye-slash' });
expect(wrapper.find('.pi.pi-eye').exists()).toBe(true); expect(wrapper.find('.pi.pi-eye').exists()).toBe(true);

View File

@ -58,19 +58,6 @@ describe('TriStateCheckbox.vue', () => {
expect(wrapper.vm.focused).toBeFalsy(); expect(wrapper.vm.focused).toBeFalsy();
expect(wrapper.emitted().blur).toBeTruthy(); expect(wrapper.emitted().blur).toBeTruthy();
}); });
it('is icon changed', async () => {
expect(wrapper.find('.p-checkbox-icon').classes()).not.toContain('pi-check');
expect(wrapper.find('.p-checkbox-icon').classes()).not.toContain('pi-times');
await wrapper.setProps({ modelValue: true });
expect(wrapper.find('.p-checkbox-icon').classes()).toContain('pi-check');
await wrapper.setProps({ modelValue: false });
expect(wrapper.find('.p-checkbox-icon').classes()).toContain('pi-times');
});
}); });
describe('UpdateModel method tests', () => { describe('UpdateModel method tests', () => {