mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #3802 - Improve folder structure for nuxt configurations
This commit is contained in:
parent
851950270b
commit
f5fe822afb
563 changed files with 1703 additions and 1095 deletions
52
components/lib/image/Image.spec.js
Normal file
52
components/lib/image/Image.spec.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import PrimeVue from 'primevue/config';
|
||||
import Image from './Image.vue';
|
||||
|
||||
describe('Image.vue', () => {
|
||||
it('should exist', () => {
|
||||
const wrapper = mount(Image, {
|
||||
global: {
|
||||
plugins: [PrimeVue],
|
||||
stubs: {
|
||||
teleport: true
|
||||
}
|
||||
},
|
||||
props: {
|
||||
src: 'images/galleria/galleria1.jpg'
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper.find('.p-image.p-component').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-image.p-component img').attributes().src).toBe('images/galleria/galleria1.jpg');
|
||||
});
|
||||
|
||||
it('should preview', async () => {
|
||||
const wrapper = mount(Image, {
|
||||
global: {
|
||||
plugins: [PrimeVue],
|
||||
stubs: {
|
||||
teleport: true
|
||||
}
|
||||
},
|
||||
props: {
|
||||
src: 'images/galleria/galleria1.jpg',
|
||||
preview: true
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper.find('.p-image-preview-container').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-image-preview-indicator').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-image-mask').exists()).toBe(false);
|
||||
|
||||
await wrapper.setData({ maskVisible: true });
|
||||
|
||||
expect(wrapper.find('.p-image-mask').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-image-toolbar').exists()).toBe(true);
|
||||
|
||||
await wrapper.setData({ maskVisible: false });
|
||||
|
||||
setTimeout(() => {
|
||||
expect(wrapper.find('.p-image-mask').exists()).toBe(false);
|
||||
}, 25);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue