Fixed #3802 - Improve folder structure for nuxt configurations

This commit is contained in:
mertsincan 2023-03-26 06:22:57 +01:00
parent 851950270b
commit f5fe822afb
563 changed files with 1703 additions and 1095 deletions

View file

@ -0,0 +1,47 @@
import { mount } from '@vue/test-utils';
import Knob from './Knob.vue';
describe('Knob.vue', () => {
let wrapper;
beforeEach(() => {
wrapper = mount(Knob, {
props: {
modelValue: 20
}
});
});
it('should exist', () => {
expect(wrapper.find('.p-knob.p-component').exists()).toBe(true);
expect(wrapper.find('.p-knob-text').text()).toBe('20');
});
it('should change with click event', async () => {
const event = { offsetX: 100, offsetY: 100 };
await wrapper.vm.onClick(event);
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([95]);
});
it('should min - max work', async () => {
await wrapper.setProps({ min: -50, max: 50 });
const event = { offsetX: 100, offsetY: 100 };
await wrapper.vm.onClick(event);
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([45]);
});
it('should step work', async () => {
await wrapper.setProps({ step: 10 });
const event = { offsetX: 18, offsetY: 30 };
await wrapper.vm.onClick(event);
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([30]);
});
});