@webitel/ui-sdk 3.1.67 → 3.1.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui-sdk.common.js +72 -77
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +72 -77
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +1 -1
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/wt-button-select/__tests__/WtButtonSelect.spec.js +1 -1
- package/src/components/molecules/wt-checkbox/__tests__/WtCheckbox.spec.js +3 -3
- package/src/components/molecules/wt-datepicker/__tests__/WtDatepicker.spec.js +2 -2
- package/src/components/molecules/wt-input/__tests__/WtInput.spec.js +2 -2
- package/src/components/molecules/wt-radio/__tests__/WtRadio.spec.js +3 -3
- package/src/components/molecules/wt-select/__tests__/WtSelect.spec.js +2 -2
- package/src/components/molecules/wt-select/mixins/__tests__/multiselectMixin.spec.js +2 -2
- package/src/components/molecules/wt-switcher/__tests__/WtSwitcher.spec.js +3 -3
- package/src/components/molecules/wt-tags-input/__tests__/WtTagsInput.spec.js +4 -4
- package/src/components/molecules/wt-textarea/__tests__/WtTextarea.spec.js +2 -2
- package/src/components/molecules/wt-time-input/__tests__/WtTimeInput.spec.js +2 -2
- package/src/components/molecules/wt-time-input/wt-time-input.vue +126 -132
- package/src/components/molecules/wt-timepicker/__tests__/WtTimepicker.spec.js +9 -9
- package/src/components/molecules/wt-timepicker/wt-timepicker.vue +7 -4
- package/src/components/organisms/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +2 -2
- package/src/components/organisms/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +4 -4
- package/src/components/organisms/wt-notifications-bar/wt-notifications-bar.vue +49 -48
- package/src/components/organisms/wt-pagination/__tests__/WtPagination.spec.js +1 -1
- package/src/components/organisms/wt-table/__tests__/WtTable.spec.js +3 -3
- package/src/components/organisms/wt-table/wt-table.vue +1 -1
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +5 -7
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +3 -3
- package/src/mixins/dataFilterMixins/__tests__/paginationFilterMixin.spec.js +23 -31
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +6 -6
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +4 -4
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +2 -2
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +3 -3
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +2 -2
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +2 -2
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +1 -1
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +1 -1
- package/src/modules/AuditForm/components/audit-form.vue +1 -1
- package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +9 -11
- package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +9 -11
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +11 -11
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +9 -11
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +9 -11
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +11 -11
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +11 -13
- package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +18 -25
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +14 -9
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +12 -14
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +4 -4
- package/src/scripts/eventBus.js +1 -1
|
@@ -6,67 +6,68 @@
|
|
|
6
6
|
:type="notification.type"
|
|
7
7
|
:key="key+notification.text"
|
|
8
8
|
@close="closeNotification(notification)"
|
|
9
|
-
>{{notification.text}}
|
|
9
|
+
>{{ notification.text }}
|
|
10
10
|
</wt-notification>
|
|
11
11
|
</transition-group>
|
|
12
12
|
</aside>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
export default {
|
|
17
|
+
name: 'wt-notifications-bar',
|
|
18
|
+
inject: ['$eventBus'],
|
|
19
|
+
data: () => ({
|
|
20
|
+
notificationDuration: 4000,
|
|
21
|
+
notifications: [],
|
|
22
|
+
}),
|
|
23
|
+
created() {
|
|
24
|
+
try {
|
|
25
|
+
this.$eventBus.$on('notification', this.showNotification);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error('wt-notifications-bar cannot work without globally registered eventBus', err);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
destroyed() {
|
|
31
|
+
this.$eventBus.$off('notification', this.showNotification);
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
showNotification(notification) {
|
|
35
|
+
this.notifications.unshift(notification);
|
|
36
|
+
setTimeout(() => this.closeNotification(notification), this.notificationDuration);
|
|
32
37
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
setTimeout(() => this.closeNotification(notification), this.notificationDuration);
|
|
37
|
-
},
|
|
38
|
-
closeNotification(notification) {
|
|
39
|
-
const index = this.notifications.indexOf(notification);
|
|
40
|
-
this.notifications.splice(index, 1);
|
|
41
|
-
},
|
|
38
|
+
closeNotification(notification) {
|
|
39
|
+
const index = this.notifications.indexOf(notification);
|
|
40
|
+
this.notifications.splice(index, 1);
|
|
42
41
|
},
|
|
43
|
-
}
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
44
|
</script>
|
|
45
45
|
|
|
46
46
|
<style lang="scss" scoped>
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
.wt-notifications-bar {
|
|
48
|
+
@extend %wt-scrollbar;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
position: fixed;
|
|
51
|
+
top: var(--notifications-bar-corner-margin);
|
|
52
|
+
right: var(--notifications-bar-corner-margin);
|
|
53
|
+
max-height: var(--notifications-bar-max-height);
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
overflow-x: hidden;
|
|
56
|
+
z-index: var(--notifications-bar-z-index);
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
58
|
+
.wt-notification {
|
|
59
|
+
margin: var(--notifications-bar-notifications-margin);
|
|
61
60
|
}
|
|
61
|
+
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
.wt-notifications-transition-enter-active,
|
|
64
|
+
.wt-notifications-transition-leave-active {
|
|
65
|
+
transition: all var(--transition);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.wt-notifications-transition-enter,
|
|
69
|
+
.wt-notifications-transition-leave-to {
|
|
70
|
+
opacity: 0;
|
|
71
|
+
transform: translateX(60px);
|
|
72
|
+
}
|
|
72
73
|
</style>
|
|
@@ -28,7 +28,7 @@ describe('WtPagination', () => {
|
|
|
28
28
|
const wrapper = mount(WtPagination, {
|
|
29
29
|
props: { isNext: true, page: 2 },
|
|
30
30
|
});
|
|
31
|
-
const pageControls = wrapper.
|
|
31
|
+
const pageControls = wrapper.findAllComponents('.wt-pagination__page-control');
|
|
32
32
|
pageControls.at(0).vm.$emit('click');
|
|
33
33
|
pageControls.at(1).vm.$emit('click');
|
|
34
34
|
expect(wrapper.emitted().prev.length).toBe(1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
import WtTable from '../wt-table.vue';
|
|
3
3
|
import WtCheckbox from '../../../molecules/wt-checkbox/wt-checkbox.vue';
|
|
4
4
|
|
|
@@ -87,7 +87,7 @@ describe('WtTable', () => {
|
|
|
87
87
|
headers,
|
|
88
88
|
data,
|
|
89
89
|
},
|
|
90
|
-
|
|
90
|
+
slots: {
|
|
91
91
|
'data-footer': '',
|
|
92
92
|
},
|
|
93
93
|
});
|
|
@@ -121,7 +121,7 @@ describe('WtTable', () => {
|
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
it('selects all rows at header checkbox click', async () => {
|
|
124
|
-
const wrapper =
|
|
124
|
+
const wrapper = mount(WtTable, {
|
|
125
125
|
props: {
|
|
126
126
|
headers,
|
|
127
127
|
data,
|
|
@@ -2,9 +2,9 @@ import { shallowMount } from '@vue/test-utils';
|
|
|
2
2
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
3
3
|
import apiFilterMixin from '../apiFilterMixin';
|
|
4
4
|
|
|
5
|
-
const router =
|
|
5
|
+
const router = createRouter({
|
|
6
6
|
history: createWebHistory(),
|
|
7
|
-
routes: [],
|
|
7
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
8
8
|
});
|
|
9
9
|
const team = ['1', '2'];
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ describe('API filter mixin', () => {
|
|
|
25
25
|
it('Correctly sets value from $route query', async () => {
|
|
26
26
|
await router.replace({ query: { team } });
|
|
27
27
|
wrapper = shallowMount(Component, {
|
|
28
|
-
plugins: [router],
|
|
28
|
+
global: { plugins: [router] },
|
|
29
29
|
});
|
|
30
30
|
await wrapper.vm.$nextTick();
|
|
31
31
|
expect(wrapper.vm.value).toEqual(team);
|
|
@@ -33,8 +33,7 @@ describe('API filter mixin', () => {
|
|
|
33
33
|
|
|
34
34
|
it('Sets empty array value if $route query is empty', async () => {
|
|
35
35
|
wrapper = shallowMount(Component, {
|
|
36
|
-
|
|
37
|
-
router,
|
|
36
|
+
global: { plugins: [router] },
|
|
38
37
|
data: () => ({
|
|
39
38
|
filterQuery: 'queue',
|
|
40
39
|
}),
|
|
@@ -45,8 +44,7 @@ describe('API filter mixin', () => {
|
|
|
45
44
|
it('Resets value after $route query reset', async () => {
|
|
46
45
|
await router.replace({ query: { team } });
|
|
47
46
|
wrapper = shallowMount(Component, {
|
|
48
|
-
|
|
49
|
-
router,
|
|
47
|
+
global: { plugins: [router] },
|
|
50
48
|
});
|
|
51
49
|
await wrapper.vm.$nextTick();
|
|
52
50
|
expect(wrapper.vm.value).toEqual(team);
|
|
@@ -13,7 +13,7 @@ const options = [{
|
|
|
13
13
|
|
|
14
14
|
const router = createRouter({
|
|
15
15
|
history: createWebHistory(),
|
|
16
|
-
routes: [],
|
|
16
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
describe('Enum filter mixin', () => {
|
|
@@ -29,7 +29,7 @@ describe('Enum filter mixin', () => {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
beforeEach(() => {
|
|
32
|
-
|
|
32
|
+
router.replace({ query: null });
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
it('Correctly sets value from $route query', async () => {
|
|
@@ -51,7 +51,7 @@ describe('Enum filter mixin', () => {
|
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
53
|
await wrapper.vm.$nextTick();
|
|
54
|
-
expect(wrapper.vm.value).toEqual(options[0]);
|
|
54
|
+
expect(wrapper.vm.value).toEqual([options[0]]);
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
it('Resets value after $route query reset', async () => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
3
3
|
import paginationFilterMixin from '../paginationFilterMixin';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const router = createRouter({
|
|
6
|
+
history: createWebHistory(),
|
|
7
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
8
|
+
});
|
|
8
9
|
const page = '2';
|
|
9
10
|
const size = '20';
|
|
10
11
|
|
|
@@ -15,15 +16,14 @@ describe('Pagination filter mixin', () => {
|
|
|
15
16
|
mixins: [paginationFilterMixin],
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
|
|
19
|
+
beforeEach(async () => {
|
|
20
|
+
await router.replace({ path: '/', query: null });
|
|
20
21
|
});
|
|
21
22
|
|
|
22
23
|
it('Correctly sets value from $route query', async () => {
|
|
23
|
-
await router.replace({ query: { page, size } });
|
|
24
|
+
await router.replace({ path: '/', query: { page, size } });
|
|
24
25
|
wrapper = shallowMount(Component, {
|
|
25
|
-
|
|
26
|
-
router,
|
|
26
|
+
global: { plugins: [router] },
|
|
27
27
|
});
|
|
28
28
|
await wrapper.vm.$nextTick();
|
|
29
29
|
expect(wrapper.vm.page).toEqual(page);
|
|
@@ -32,8 +32,7 @@ describe('Pagination filter mixin', () => {
|
|
|
32
32
|
|
|
33
33
|
it('Sets initial value if $route query is empty', async () => {
|
|
34
34
|
wrapper = shallowMount(Component, {
|
|
35
|
-
|
|
36
|
-
router,
|
|
35
|
+
global: { plugins: [router] },
|
|
37
36
|
data: () => ({
|
|
38
37
|
filterQuery: 'queue',
|
|
39
38
|
}),
|
|
@@ -43,50 +42,43 @@ describe('Pagination filter mixin', () => {
|
|
|
43
42
|
});
|
|
44
43
|
|
|
45
44
|
it('Resets value after $route query reset', async () => {
|
|
46
|
-
await router.replace({ query: { page, size } });
|
|
45
|
+
await router.replace({ path: '/', query: { page, size } });
|
|
47
46
|
wrapper = shallowMount(Component, {
|
|
48
|
-
|
|
49
|
-
router,
|
|
47
|
+
global: { plugins: [router] },
|
|
50
48
|
});
|
|
51
|
-
await wrapper.vm.$router.replace({ query: null });
|
|
49
|
+
await wrapper.vm.$router.replace({ path: '/', query: null });
|
|
52
50
|
await wrapper.vm.$nextTick();
|
|
53
51
|
expect(wrapper.vm.page).toEqual('1');
|
|
54
52
|
expect(wrapper.vm.size).toEqual('10');
|
|
55
53
|
});
|
|
56
54
|
|
|
57
55
|
it('At "prev" page, changes query and emits event', async () => {
|
|
58
|
-
await router.replace({ query: { page, size } });
|
|
56
|
+
await router.replace({ path: '/', query: { page, size } });
|
|
59
57
|
wrapper = shallowMount(Component, {
|
|
60
|
-
|
|
61
|
-
router,
|
|
58
|
+
global: { plugins: [router] },
|
|
62
59
|
});
|
|
63
|
-
wrapper.
|
|
64
|
-
wrapper.vm.prev();
|
|
60
|
+
await wrapper.vm.prev();
|
|
65
61
|
expect(wrapper.emitted().input).toBeTruthy();
|
|
66
62
|
expect(wrapper.vm.$route.query.page).toBe(`${page - 1}`);
|
|
67
63
|
});
|
|
68
64
|
|
|
69
65
|
it('At "next" page, changes query and emits event', async () => {
|
|
70
|
-
await router.replace({ query: { page, size } });
|
|
66
|
+
await router.replace({ path: '/', query: { page, size } });
|
|
71
67
|
wrapper = shallowMount(Component, {
|
|
72
|
-
|
|
73
|
-
router,
|
|
68
|
+
global: { plugins: [router] },
|
|
74
69
|
});
|
|
75
|
-
wrapper.
|
|
76
|
-
wrapper.vm.next();
|
|
70
|
+
await wrapper.vm.next();
|
|
77
71
|
expect(wrapper.emitted().input).toBeTruthy();
|
|
78
72
|
expect(wrapper.vm.$route.query.page).toBe(`${+page + 1}`);
|
|
79
73
|
});
|
|
80
74
|
|
|
81
75
|
it('At "sizeChange", changes query and emits event', async () => {
|
|
82
76
|
const newSize = '40';
|
|
83
|
-
await router.replace({ query: { page, size } });
|
|
77
|
+
await router.replace({ path: '/', query: { page, size } });
|
|
84
78
|
wrapper = shallowMount(Component, {
|
|
85
|
-
|
|
86
|
-
router,
|
|
79
|
+
global: { plugins: [router] },
|
|
87
80
|
});
|
|
88
|
-
wrapper.
|
|
89
|
-
wrapper.vm.sizeChange(newSize);
|
|
81
|
+
await wrapper.vm.sizeChange(newSize);
|
|
90
82
|
expect(wrapper.emitted().input).toBeTruthy();
|
|
91
83
|
expect(wrapper.vm.$route.query.size).toBe(newSize);
|
|
92
84
|
});
|
|
@@ -4,7 +4,7 @@ import sortFilterMixin from '../sortFilterMixin';
|
|
|
4
4
|
|
|
5
5
|
const router = createRouter({
|
|
6
6
|
history: createWebHistory(),
|
|
7
|
-
routes: [],
|
|
7
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
const headers = [{
|
|
@@ -27,8 +27,8 @@ describe('Sort filter mixin', () => {
|
|
|
27
27
|
data: () => ({ headers }),
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
beforeEach(() => {
|
|
31
|
-
router.replace('/');
|
|
30
|
+
beforeEach(async () => {
|
|
31
|
+
await router.replace('/');
|
|
32
32
|
wrapper = shallowMount(Component, {
|
|
33
33
|
global: { plugins: [router] },
|
|
34
34
|
});
|
|
@@ -40,10 +40,10 @@ describe('Sort filter mixin', () => {
|
|
|
40
40
|
expect(queue.sort).toEqual('asc');
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
it('After "sort" trigger, header column sort value changes properly', () => {
|
|
43
|
+
it('After "sort" trigger, header column sort value changes properly', async () => {
|
|
44
44
|
let queue;
|
|
45
45
|
queue = wrapper.vm.headers.find((header) => header.value === 'queue');
|
|
46
|
-
wrapper.vm.sort(queue);
|
|
46
|
+
await wrapper.vm.sort(queue);
|
|
47
47
|
queue = wrapper.vm.headers.find((header) => header.value === 'queue');
|
|
48
48
|
expect(queue.sort).toEqual('asc');
|
|
49
49
|
});
|
|
@@ -51,7 +51,7 @@ describe('Sort filter mixin', () => {
|
|
|
51
51
|
it('After "sort" trigger, url query changes properly', async () => {
|
|
52
52
|
await router.replace({ path: '/', query: { sort: '+queue' } });
|
|
53
53
|
const queue = wrapper.vm.headers.find((header) => header.value === 'queue');
|
|
54
|
-
wrapper.vm.sort(queue);
|
|
54
|
+
await wrapper.vm.sort(queue);
|
|
55
55
|
expect(wrapper.vm.$route.query.sort).toEqual('-queue');
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -4,7 +4,7 @@ import _urlControllerMixin from '../_urlControllerMixin/_urlControllerMixin';
|
|
|
4
4
|
|
|
5
5
|
const router = createRouter({
|
|
6
6
|
history: createWebHistory(),
|
|
7
|
-
routes: [],
|
|
7
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
const filterQuery = 'team';
|
|
@@ -27,21 +27,21 @@ describe('URL Controller mixin Set and Get operations', () => {
|
|
|
27
27
|
|
|
28
28
|
it('Array of objects', async () => {
|
|
29
29
|
const value = [{ name: 'team 1', id: '1' }, { name: 'team 2', id: '2' }];
|
|
30
|
-
wrapper.vm.setValueToQuery({ filterQuery, value });
|
|
30
|
+
await wrapper.vm.setValueToQuery({ filterQuery, value });
|
|
31
31
|
const queryValue = wrapper.vm.getValueFromQuery({ filterQuery });
|
|
32
32
|
expect(queryValue).toEqual(['1', '2']);
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
it('Array of values', async () => {
|
|
36
36
|
const value = ['hello', '1'];
|
|
37
|
-
wrapper.vm.setValueToQuery({ filterQuery, value });
|
|
37
|
+
await wrapper.vm.setValueToQuery({ filterQuery, value });
|
|
38
38
|
const queryValue = wrapper.vm.getValueFromQuery({ filterQuery });
|
|
39
39
|
expect(queryValue).toEqual(value);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
it('String value', async () => {
|
|
43
43
|
const value = 'hello there';
|
|
44
|
-
wrapper.vm.setValueToQuery({ filterQuery, value });
|
|
44
|
+
await wrapper.vm.setValueToQuery({ filterQuery, value });
|
|
45
45
|
const queryValue = wrapper.vm.getValueFromQuery({ filterQuery });
|
|
46
46
|
expect(queryValue).toEqual(value);
|
|
47
47
|
});
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
});
|
|
12
12
|
},
|
|
13
13
|
|
|
14
|
-
setValueToQuery({ filterQuery, value, storedProp = 'id' }) {
|
|
14
|
+
async setValueToQuery({ filterQuery, value, storedProp = 'id' }) {
|
|
15
15
|
let newValue = '';
|
|
16
16
|
if (Array.isArray(value)) {
|
|
17
17
|
if (value.length && typeof value[0] !== 'object') {
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
newValue = value;
|
|
24
24
|
}
|
|
25
25
|
if (!deepEqual(this.$route.query[filterQuery], newValue)) {
|
|
26
|
-
this.changeRouteQuery({
|
|
26
|
+
await this.changeRouteQuery({
|
|
27
27
|
value: newValue,
|
|
28
28
|
filterQuery,
|
|
29
29
|
});
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
52
52
|
this.$emit('input');
|
|
53
53
|
const value = `${+this.page + 1}`;
|
|
54
54
|
this.page = value;
|
|
55
|
-
this.setValueToQuery({
|
|
55
|
+
return this.setValueToQuery({
|
|
56
56
|
filterQuery: 'page',
|
|
57
57
|
value,
|
|
58
58
|
});
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
this.$emit('input');
|
|
63
63
|
const value = `${+this.page - 1}`;
|
|
64
64
|
this.page = value;
|
|
65
|
-
this.setValueToQuery({
|
|
65
|
+
return this.setValueToQuery({
|
|
66
66
|
filterQuery: 'page',
|
|
67
67
|
value,
|
|
68
68
|
});
|
|
@@ -70,7 +70,7 @@ export default {
|
|
|
70
70
|
|
|
71
71
|
sizeChange(value) {
|
|
72
72
|
this.$emit('input');
|
|
73
|
-
this.setValueToQuery({
|
|
73
|
+
return this.setValueToQuery({
|
|
74
74
|
filterQuery: 'size',
|
|
75
75
|
value,
|
|
76
76
|
});
|
|
@@ -49,7 +49,7 @@ export default {
|
|
|
49
49
|
methods: {
|
|
50
50
|
sort(column) {
|
|
51
51
|
const order = getNextSortOrder(column.sort);
|
|
52
|
-
this.setValue({ column, order });
|
|
52
|
+
return this.setValue({ column, order });
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
setValue({ column, order }) {
|
|
@@ -58,7 +58,7 @@ export default {
|
|
|
58
58
|
sort: col === column ? order : null,
|
|
59
59
|
}));
|
|
60
60
|
const value = encodeSortQuery({ column, order });
|
|
61
|
-
this.setValueToQuery({
|
|
61
|
+
return this.setValueToQuery({
|
|
62
62
|
value,
|
|
63
63
|
filterQuery: this.filterQuery,
|
|
64
64
|
});
|
|
@@ -26,7 +26,7 @@ describe('Validation mixin', () => {
|
|
|
26
26
|
props: {
|
|
27
27
|
v: {
|
|
28
28
|
$error: true,
|
|
29
|
-
email:
|
|
29
|
+
email: { $invalid: true },
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
});
|
|
@@ -38,7 +38,7 @@ describe('Validation mixin', () => {
|
|
|
38
38
|
props: {
|
|
39
39
|
v: {
|
|
40
40
|
$error: true,
|
|
41
|
-
required:
|
|
41
|
+
required: { $invalid: true },
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
});
|
package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js
CHANGED
|
@@ -53,7 +53,7 @@ describe('AuditFormQuestionWriteWrapper', () => {
|
|
|
53
53
|
},
|
|
54
54
|
});
|
|
55
55
|
wrapper.find('.audit-form-question-write-content-question')
|
|
56
|
-
.findComponent({ name: 'wt-select' }).vm.$emit('input', { value:
|
|
56
|
+
.findComponent({ name: 'wt-select' }).vm.$emit('input', { value: EngineAuditQuestionType.Option });
|
|
57
57
|
expect(wrapper.emitted()['change:question'][0][0])
|
|
58
58
|
.toEqual(generateQuestionOptionsSchema());
|
|
59
59
|
});
|
|
@@ -29,7 +29,7 @@ describe('AuditForm', () => {
|
|
|
29
29
|
});
|
|
30
30
|
wrapper.findComponent('.audit-form__add-button').vm.$emit('click');
|
|
31
31
|
expect(wrapper.emitted()['update:questions'][0][0])
|
|
32
|
-
.toEqual([generateQuestionSchema()]);
|
|
32
|
+
.toEqual([generateQuestionSchema({ required: true })]);
|
|
33
33
|
});
|
|
34
34
|
it('delete event from child question emits update without passed question', () => {
|
|
35
35
|
const wrapper = shallowMount(AuditForm, {
|
|
@@ -132,7 +132,7 @@ const { reloadSortable } = useDestroyableSortable(sortableWrapper, {
|
|
|
132
132
|
},
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
watch(v$, () => emit('update:validation', { invalid: isInvalidForm, v$ }));
|
|
135
|
+
watch(v$, () => emit('update:validation', { invalid: isInvalidForm.value, v$ }));
|
|
136
136
|
watchEffect(initResult);
|
|
137
137
|
|
|
138
138
|
onMounted(() => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { shallowMount
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import AbstractApiFilter from '../abstract-api-filter.vue';
|
|
5
5
|
import ApiFilterSchema from '../../classes/ApiFilterSchema';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const router = createRouter({
|
|
8
|
+
history: createWebHistory(),
|
|
9
|
+
routes: [],
|
|
10
|
+
});
|
|
11
11
|
|
|
12
12
|
describe('Abstract Api Filter', () => {
|
|
13
13
|
const namespace = 'jest';
|
|
@@ -17,7 +17,7 @@ describe('Abstract Api Filter', () => {
|
|
|
17
17
|
const fetchSelectedMock = jest.fn(() => ({ items: [] }));
|
|
18
18
|
jest.spyOn(filterSchema, 'search').mockImplementation(searchMock);
|
|
19
19
|
jest.spyOn(filterSchema, 'fetchSelected').mockImplementation(fetchSelectedMock);
|
|
20
|
-
const store =
|
|
20
|
+
const store = createStore({
|
|
21
21
|
modules: {
|
|
22
22
|
[namespace]: {
|
|
23
23
|
namespaced: true,
|
|
@@ -29,9 +29,7 @@ describe('Abstract Api Filter', () => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const mountOptions = {
|
|
32
|
-
|
|
33
|
-
store,
|
|
34
|
-
router,
|
|
32
|
+
global: { plugins: [store, router] },
|
|
35
33
|
props: {
|
|
36
34
|
namespace,
|
|
37
35
|
filterQuery,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { shallowMount
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import AbstractEnumFilter from '../abstract-enum-filter.vue';
|
|
5
5
|
import EnumFilterSchema from '../../classes/EnumFilterSchema';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const router = createRouter({
|
|
8
|
+
history: createWebHistory(),
|
|
9
|
+
routes: [],
|
|
10
|
+
});
|
|
11
11
|
|
|
12
12
|
describe('Abstract Enum Filter', () => {
|
|
13
13
|
const namespace = 'jest';
|
|
14
14
|
const filterQuery = 'jest';
|
|
15
15
|
const filterSchema = new EnumFilterSchema({ locale: {} });
|
|
16
|
-
const store =
|
|
16
|
+
const store = createStore({
|
|
17
17
|
modules: {
|
|
18
18
|
[namespace]: {
|
|
19
19
|
namespaced: true,
|
|
@@ -25,9 +25,7 @@ describe('Abstract Enum Filter', () => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const mountOptions = {
|
|
28
|
-
|
|
29
|
-
store,
|
|
30
|
-
router,
|
|
28
|
+
global: { plugins: [store, router] },
|
|
31
29
|
props: {
|
|
32
30
|
namespace,
|
|
33
31
|
filterQuery,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { shallowMount
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import { createRouter, createWebHistory } from 'vue-router';
|
|
4
4
|
import DatetimeFilter from '../filter-datetime.vue';
|
|
5
5
|
import BaseFilterSchema from '../../classes/BaseFilterSchema';
|
|
6
6
|
import baseFilterMixin from '../../mixins/baseFilterMixin/baseFilterMixin';
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const router = createRouter({
|
|
9
|
+
history: createWebHistory(),
|
|
10
|
+
routes: [{ path: '/', name: 'jest' }],
|
|
11
|
+
});
|
|
12
12
|
|
|
13
13
|
describe('DatetimeFilter Filter', () => {
|
|
14
14
|
const namespace = 'jest';
|
|
15
15
|
const filterQuery = 'jest';
|
|
16
16
|
const filterSchema = new BaseFilterSchema();
|
|
17
|
-
const store =
|
|
17
|
+
const store = createStore({
|
|
18
18
|
modules: {
|
|
19
19
|
[namespace]: {
|
|
20
20
|
namespaced: true,
|
|
@@ -26,9 +26,9 @@ describe('DatetimeFilter Filter', () => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const mountOptions = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
global: {
|
|
30
|
+
plugins: [router, store],
|
|
31
|
+
},
|
|
32
32
|
props: {
|
|
33
33
|
namespace,
|
|
34
34
|
filterQuery,
|