- fix Button.spec.js, Checkbox.spec.js, ColorPicker.spec.js, ContextMenu.spec.js

pull/6170/head
uros 2024-08-01 22:56:35 +02:00
parent f8d1dfc8b2
commit a378599783
4 changed files with 9 additions and 9 deletions

View File

@ -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>`);
});
});

View File

@ -21,6 +21,6 @@ describe('Checkbox.vue', () => {
it('should exist', async () => {
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);
});
});

View File

@ -21,11 +21,11 @@ describe('ColorPicker.vue', () => {
it('should exist', () => {
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 () => {
const input = wrapper.find('.p-colorpicker-preview.p-inputtext');
const input = wrapper.find('input.p-colorpicker-preview');
const onInputClick = vi.spyOn(wrapper.vm, 'onInputClick');
await input.trigger('click');
@ -37,7 +37,7 @@ describe('ColorPicker.vue', () => {
});
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');
@ -49,11 +49,11 @@ describe('ColorPicker.vue', () => {
wrapper.vm.onColorMousedown(event);
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);
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)');
});
});

View File

@ -154,8 +154,8 @@ describe('ContextMenu.vue', () => {
expect(show).toHaveBeenCalled();
expect(wrapper.find('.p-contextmenu.p-component').exists()).toBe(true);
expect(wrapper.findAll('.p-menuitem').length).toBe(5);
expect(wrapper.findAll('.p-menuitem-text')[0].text()).toBe('File');
expect(wrapper.findAll('.p-contextmenu-item').length).toBe(5);
expect(wrapper.findAll('.p-contextmenu-item-label')[0].text()).toBe('File');
});
it('should hide menu', async () => {