- fix Fieldset.spec.js, Galleria.spec.js

pull/6170/head
uros 2024-08-01 21:44:22 +02:00
parent cdcee4ca8a
commit f5efd2b0f7
2 changed files with 5 additions and 4 deletions

View File

@ -20,7 +20,8 @@ describe('Fieldset.vue', () => {
it('should exist', () => {
expect(wrapper.find('.p-fieldset.p-component').exists()).toBe(true);
expect(wrapper.find('.p-fieldset-legend').exists()).toBe(true);
expect(wrapper.find('.p-toggleable-content').exists()).toBe(true);
expect(wrapper.find('.p-fieldset-toggle-button').exists()).toBe(true);
expect(wrapper.find('.p-fieldset-content-container').exists()).toBe(true);
});
it('toggleable check', async () => {

View File

@ -48,17 +48,17 @@ describe('Gallleria.vue', () => {
it('should exist', () => {
expect(wrapper.find('.p-galleria.p-component').exists()).toBe(true);
expect(wrapper.findAll('.p-galleria-item-container > .p-galleria-item').length).toBe(1);
expect(wrapper.findAll('.p-galleria-items > .p-galleria-item').length).toBe(1);
expect(wrapper.findAll('.p-galleria-thumbnail-item-active').length).toBe(2);
});
it('should active item change', async () => {
expect(wrapper.find('.p-galleria-item-container img').attributes().alt).toBe('Description for Image 1');
expect(wrapper.find('.p-galleria-items-container img').attributes().alt).toBe('Description for Image 1');
wrapper.vm.onActiveItemChange(1);
await wrapper.setProps({ activeIndex: 1 });
expect(wrapper.find('.p-galleria-item-container img').attributes().alt).toBe('Description for Image 2');
expect(wrapper.find('.p-galleria-items-container img').attributes().alt).toBe('Description for Image 2');
expect(wrapper.emitted()['update:activeIndex'][0]).toEqual([1]);
});
});