- fix Button.spec.js, Checkbox.spec.js, ColorPicker.spec.js, ContextMenu.spec.js
parent
f8d1dfc8b2
commit
a378599783
|
@ -79,6 +79,6 @@ describe('Button.vue', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(wrapper.html()).toBe(`<button class="p-button p-component" type="button" data-pc-name="button" data-pc-section="root"><span class="ml-2 font-bold">Default PrimeVue Button</span></button>`);
|
expect(wrapper.html()).toBe(`<button class="p-button p-component" type="button" data-pc-name="button" data-p-disabled="false" data-pc-section="root" pc7=""><span class="ml-2 font-bold">Default PrimeVue Button</span></button>`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,6 +21,6 @@ describe('Checkbox.vue', () => {
|
||||||
it('should exist', async () => {
|
it('should exist', async () => {
|
||||||
await wrapper.setProps({ modelValue: true });
|
await wrapper.setProps({ modelValue: true });
|
||||||
|
|
||||||
expect(wrapper.find('.p-checkbox.p-highlight').exists()).toBe(true);
|
expect(wrapper.find('.p-checkbox.p-checkbox-checked').exists()).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,11 +21,11 @@ describe('ColorPicker.vue', () => {
|
||||||
|
|
||||||
it('should exist', () => {
|
it('should exist', () => {
|
||||||
expect(wrapper.find('.p-colorpicker.p-component').exists()).toBe(true);
|
expect(wrapper.find('.p-colorpicker.p-component').exists()).toBe(true);
|
||||||
expect(wrapper.find('.p-colorpicker-preview.p-inputtext').exists()).toBe(true);
|
expect(wrapper.find('input.p-colorpicker-preview').exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should input click triggered', async () => {
|
it('should input click triggered', async () => {
|
||||||
const input = wrapper.find('.p-colorpicker-preview.p-inputtext');
|
const input = wrapper.find('input.p-colorpicker-preview');
|
||||||
const onInputClick = vi.spyOn(wrapper.vm, 'onInputClick');
|
const onInputClick = vi.spyOn(wrapper.vm, 'onInputClick');
|
||||||
|
|
||||||
await input.trigger('click');
|
await input.trigger('click');
|
||||||
|
@ -37,7 +37,7 @@ describe('ColorPicker.vue', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should mouse events triggered', async () => {
|
it('should mouse events triggered', async () => {
|
||||||
const input = wrapper.find('.p-colorpicker-preview.p-inputtext');
|
const input = wrapper.find('input.p-colorpicker-preview');
|
||||||
|
|
||||||
await input.trigger('click');
|
await input.trigger('click');
|
||||||
|
|
||||||
|
@ -49,11 +49,11 @@ describe('ColorPicker.vue', () => {
|
||||||
wrapper.vm.onColorMousedown(event);
|
wrapper.vm.onColorMousedown(event);
|
||||||
|
|
||||||
expect(onColorMousedown).toHaveBeenCalled();
|
expect(onColorMousedown).toHaveBeenCalled();
|
||||||
expect(wrapper.find('.p-colorpicker-preview.p-inputtext').element.style.backgroundColor).not.toBe('rgb(255, 0, 0)');
|
expect(wrapper.find('input.p-colorpicker-preview').element.style.backgroundColor).not.toBe('rgb(255, 0, 0)');
|
||||||
|
|
||||||
wrapper.vm.onHueMousedown(event2);
|
wrapper.vm.onHueMousedown(event2);
|
||||||
|
|
||||||
expect(onHueMousedown).toHaveBeenCalled();
|
expect(onHueMousedown).toHaveBeenCalled();
|
||||||
expect(wrapper.find('.p-colorpicker-preview.p-inputtext').element.style.backgroundColor).not.toBe('rgb(255, 0, 0)');
|
expect(wrapper.find('input.p-colorpicker-preview').element.style.backgroundColor).not.toBe('rgb(255, 0, 0)');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -154,8 +154,8 @@ describe('ContextMenu.vue', () => {
|
||||||
|
|
||||||
expect(show).toHaveBeenCalled();
|
expect(show).toHaveBeenCalled();
|
||||||
expect(wrapper.find('.p-contextmenu.p-component').exists()).toBe(true);
|
expect(wrapper.find('.p-contextmenu.p-component').exists()).toBe(true);
|
||||||
expect(wrapper.findAll('.p-menuitem').length).toBe(5);
|
expect(wrapper.findAll('.p-contextmenu-item').length).toBe(5);
|
||||||
expect(wrapper.findAll('.p-menuitem-text')[0].text()).toBe('File');
|
expect(wrapper.findAll('.p-contextmenu-item-label')[0].text()).toBe('File');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should hide menu', async () => {
|
it('should hide menu', async () => {
|
||||||
|
|
Loading…
Reference in New Issue