primevue-mirror/tests/unit/Dropdown.spec.js

33 lines
886 B
JavaScript
Raw Normal View History

2022-02-09 06:28:25 +00:00
import { mount } from '@vue/test-utils';
import PrimeVue from '@/components/config/PrimeVue';
import Dropdown from '@/components/dropdown/Dropdown.vue';
'use strict';
describe('Dropdown', () => {
let wrapper;
beforeEach(() => {
jest.useFakeTimers();
wrapper = mount(Dropdown, {
global: {
plugins: [PrimeVue]
}
});
});
it('should Dropdown exist', async () => {
expect(wrapper.find('.p-dropdown.p-component').exists()).toBe(true);
await wrapper.trigger('click');
// console.log('before', new Date());
// Promise.resolve().then(() => jest.advanceTimersByTime(1000));
jest.advanceTimersByTime(1000);
// console.log('after', new Date());
// expect(wrapper.find('.p-dropdowwn-panel')).toBe(true);
// console.log(wrapper.html());
})
});