storj/web/satellite/tests/unit/Checkbox.spec.ts
Nikolay Yurchenko 354337a18b
[WIP] Header satellite ui initial markup (#651)
* [V3-635] created Project Dropdown list

* Deleting redundant package-lock.json

* [V3-637] New Project button and popup markup

* component structure and placement changed

* [V3-636] created user profile settings markup

* navigation area created
2018-11-14 16:00:01 +02:00

31 lines
697 B
TypeScript

import { shallowMount, mount } from '@vue/test-utils';
import Checkbox from '@/components/common/Checkbox.vue';
describe('Checkbox.vue', () => {
it('renders correctly', () => {
const wrapper = shallowMount(Checkbox);
expect(wrapper).toMatchSnapshot();
});
it('emit setData on change correctly', () => {
const wrapper = mount(Checkbox);
wrapper.find("input").trigger('change');
wrapper.find("input").trigger('change');
expect(wrapper.emitted("setData").length).toEqual(2);
});
it('emits with data correctly', () => {
const wrapper = mount(Checkbox);
wrapper.vm.$emit('setData', true);
expect(wrapper.emitted("setData")[0][0]).toEqual(true);
});
});