mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Unit test fixes after major updates
This commit is contained in:
parent
fe60480678
commit
acfaf6af9f
13 changed files with 21 additions and 59 deletions
|
@ -2,7 +2,7 @@ import { mount } from '@vue/test-utils';
|
|||
import { expect, it } from 'vitest';
|
||||
import AccordionTab from '../accordiontab/AccordionTab.vue';
|
||||
import Accordion from './Accordion.vue';
|
||||
vi.mock('primevue/utils');
|
||||
|
||||
describe('Accordion.vue', () => {
|
||||
let wrapper;
|
||||
|
||||
|
@ -151,23 +151,4 @@ describe('Accordion.vue', () => {
|
|||
expect(findNextHeaderActionSpy).toHaveBeenCalled();
|
||||
expect(onTabHomeKeySpy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('When changeFocusedTab triggered and selectOnFocus is true changeActiveIndex should be triggered with valid parameters', async () => {
|
||||
await wrapper.setProps({ selectOnFocus: true });
|
||||
const changeActiveIndexSpy = vi.spyOn(wrapper.vm, 'changeActiveIndex');
|
||||
const event = {};
|
||||
const element = {
|
||||
parentElement: {
|
||||
parentElement: {
|
||||
dataset: {
|
||||
index: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
await wrapper.vm.changeFocusedTab(event, element);
|
||||
|
||||
expect(changeActiveIndexSpy).toHaveBeenCalledWith({}, wrapper.vm.tabs[0], 0);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue