Checkbox test added

pull/2305/head
Tuğçe Küçükoğlu 2022-03-10 13:14:00 +03:00 committed by Tuğçe Küçükoğlu
parent c931ae68bb
commit 344d1ee18b
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
import { mount } from '@vue/test-utils';
import Checkbox from './Checkbox.vue';
describe('Checkbox.vue', () => {
let wrapper;
beforeEach(() => {
wrapper = mount(Checkbox, {
props: {
modelValue: false,
binary: true
}
});
});
it('should exist', () => {
expect(wrapper.find('.p-checkbox.p-component').exists()).toBe(true);
expect(wrapper.find('.p-checkbox-icon.pi.pi-check').exists()).toBe(false);
});
it('should exist', async () => {
await wrapper.setProps({ modelValue: true });
expect(wrapper.find('.p-checkbox-checked').exists()).toBe(true);
expect(wrapper.find('.p-checkbox-box.p-highlight').exists()).toBe(true);
expect(wrapper.find('.p-checkbox-icon.pi.pi-check').exists()).toBe(true);
});
});