storj/web/satellite/tests/unit/Checkbox.spec.ts
Nikolay Yurchenko 8d81617481 Satellite frontend initial (#515)
* initial frontend arch satellite account

* V3-500 register page
2018-11-05 17:26:18 +02:00

31 lines
690 B
TypeScript

import { shallowMount, mount } from '@vue/test-utils';
import Checkbox from '@/components/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);
});
});