@webitel/ui-sdk 2.1.48 → 3.0.1
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 +12501 -19720
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +12499 -19718
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +4 -6
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +24 -15
- package/src/components/atoms/wt-button/__tests__/WtButton.spec.js +1 -1
- package/src/components/atoms/wt-context-menu/__tests__/WtContextMenu.spec.js +1 -1
- package/src/components/atoms/wt-icon/__tests__/WtIcon.spec.js +2 -2
- package/src/components/atoms/wt-indicator/__tests__/WtIndicator.spec.js +2 -2
- package/src/components/atoms/wt-rounded-action/__tests__/WtRoundedAction.spec.js +1 -1
- package/src/components/atoms/wt-tooltip/__tests__/WtTooltip.spec.js +1 -1
- package/src/components/index.js +0 -4
- package/src/components/molecules/wt-checkbox/__tests__/WtCheckbox.spec.js +2 -2
- package/src/components/molecules/wt-datepicker/__tests__/WtDatepicker.spec.js +1 -1
- package/src/components/molecules/wt-datetimepicker/__tests__/WtDatetimepicker.spec.js +20 -17
- package/src/components/molecules/wt-icon-btn/__tests__/WtIconBtn.spec.js +1 -1
- package/src/components/molecules/wt-icon-btn/wt-icon-btn.vue +3 -0
- package/src/components/molecules/wt-input/__tests__/WtInput.spec.js +1 -1
- package/src/components/molecules/wt-input/wt-input.vue +10 -12
- package/src/components/molecules/wt-progress-bar/__tests__/WtProgressBar.spec.js +2 -2
- package/src/components/molecules/wt-radio/__tests__/WtRadio.spec.js +2 -2
- package/src/components/molecules/wt-select/__tests__/WtSelect.spec.js +1 -1
- package/src/components/molecules/wt-select/mixins/__tests__/multiselectMixin.spec.js +2 -2
- package/src/components/molecules/wt-select/mixins/multiselectMixin.js +1 -1
- package/src/components/molecules/wt-select/wt-select.vue +5 -5
- package/src/components/molecules/wt-switcher/__tests__/WtSwitcher.spec.js +2 -2
- package/src/components/molecules/wt-tabs/__tests__/WtTabs.spec.js +3 -3
- package/src/components/molecules/wt-tags-input/__tests__/WtTagsInput.spec.js +3 -3
- package/src/components/molecules/wt-tags-input/wt-tags-input.vue +1 -1
- package/src/components/molecules/wt-textarea/__tests__/WtTextarea.spec.js +2 -2
- package/src/components/molecules/wt-time-input/__tests__/WtTimeInput.spec.js +1 -1
- package/src/components/molecules/wt-timepicker/__tests__/WtTimepicker.spec.js +4 -4
- package/src/components/organisms/wt-app-header/__tests__/WtAppNavigator.spec.js +1 -1
- package/src/components/organisms/wt-app-header/__tests__/WtHeaderActions.spec.js +1 -1
- package/src/components/organisms/wt-error-page/__tests__/wt-error-page.spec.js +3 -3
- package/src/components/organisms/wt-headline-nav/__tests__/wt-headline-nav.spec.js +1 -1
- package/src/components/organisms/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +20 -16
- package/src/components/organisms/wt-notifications-bar/wt-notifications-bar.vue +1 -0
- package/src/components/organisms/wt-status-select/wt-status-select.vue +2 -2
- package/src/components/organisms/wt-table/__tests__/WtTable.spec.js +7 -7
- package/src/components/organisms/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +3 -3
- package/src/components/transitions/wt-expand-transition.vue +41 -39
- package/src/css/components/molecules/wt-select/_multiselect.scss +1 -1
- package/src/locale/i18n.js +3 -5
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +8 -8
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +15 -11
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +7 -10
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +9 -9
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +3 -3
- package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +1 -1
- package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +1 -1
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +1 -1
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +1 -1
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +1 -1
- package/src/modules/Userinfo/components/__tests__/auth.spec.js +11 -12
- package/src/plugins/breakpoint/breakpoint.plugin.js +3 -2
- package/src/scripts/eventBus.js +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve-lib": "vue-cli-service serve",
|
|
@@ -27,45 +27,54 @@
|
|
|
27
27
|
"CHANGELOG.md"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@vue/compat": "^3.2.47",
|
|
30
31
|
"clipboard-copy": "^4.0.1",
|
|
31
32
|
"core-js": "^3.6.5",
|
|
32
33
|
"csv-stringify": "^5.5.3",
|
|
33
34
|
"deep-copy": "^1.4.2",
|
|
34
35
|
"deep-equal": "^2.0.3",
|
|
35
36
|
"file-saver": "^2.0.2",
|
|
36
|
-
"floating-vue": "^
|
|
37
|
+
"floating-vue": "^2.0.0-beta.20",
|
|
37
38
|
"jszip": "^3.5.0",
|
|
38
39
|
"jszip-utils": "^0.1.0",
|
|
39
40
|
"node-polyfill-webpack-plugin": "^1.1.4",
|
|
40
41
|
"plyr": "3.6.2",
|
|
41
|
-
"
|
|
42
|
-
"vue
|
|
43
|
-
"vue-
|
|
42
|
+
"tiny-emitter": "^2.1.0",
|
|
43
|
+
"vue": "^3.2.47",
|
|
44
|
+
"vue-i18n": "^9.2.2",
|
|
45
|
+
"vue-multiselect": "^3.0.0-beta.1",
|
|
44
46
|
"vue-observe-visibility": "^1.0.0",
|
|
45
|
-
"vue-router": "^
|
|
47
|
+
"vue-router": "^4.1.6",
|
|
46
48
|
"vuejs-datepicker": "^1.6.2",
|
|
47
49
|
"webitel-sdk": "^0.1.157"
|
|
48
50
|
},
|
|
49
51
|
"devDependencies": {
|
|
50
52
|
"@babel/eslint-parser": "^7.17.0",
|
|
51
53
|
"@testing-library/jest-dom": "^5.16.2",
|
|
52
|
-
"@vue/cli-plugin-babel": "~5.0.
|
|
53
|
-
"@vue/cli-plugin-eslint": "~5.0.
|
|
54
|
-
"@vue/cli-plugin-router": "^5.0.
|
|
55
|
-
"@vue/cli-plugin-unit-jest": "^5.0.
|
|
56
|
-
"@vue/cli-service": "~5.0.
|
|
54
|
+
"@vue/cli-plugin-babel": "~5.0.8",
|
|
55
|
+
"@vue/cli-plugin-eslint": "~5.0.8",
|
|
56
|
+
"@vue/cli-plugin-router": "^5.0.8",
|
|
57
|
+
"@vue/cli-plugin-unit-jest": "^5.0.8",
|
|
58
|
+
"@vue/cli-service": "~5.0.8",
|
|
59
|
+
"@vue/compiler-sfc": "^3.2.47",
|
|
57
60
|
"@vue/eslint-config-airbnb": "^6.0.0",
|
|
58
|
-
"@vue/test-utils": "^
|
|
59
|
-
"@vue/
|
|
61
|
+
"@vue/test-utils": "^2.3.0",
|
|
62
|
+
"@vue/vue3-jest": "^29.2.2",
|
|
60
63
|
"bamboo-jest-reporter": "^1.0.3",
|
|
61
64
|
"eslint": "^8.14.0",
|
|
62
65
|
"eslint-plugin-import": "^2.20.2",
|
|
63
66
|
"eslint-plugin-vue": "^8.7.1",
|
|
64
67
|
"husky": "^7.0.0",
|
|
68
|
+
"jest-environment-jsdom": "^29.4.3",
|
|
65
69
|
"sass": "^1.51.0",
|
|
66
70
|
"sass-loader": "^12.6.0",
|
|
67
71
|
"svg-sprite-loader": "^6.0.11",
|
|
68
|
-
"
|
|
69
|
-
|
|
72
|
+
"vuex": "^4.1.0"
|
|
73
|
+
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"@vue/vue3-jest": "^29.2.2",
|
|
76
|
+
"vue": "^3.2.47",
|
|
77
|
+
"babel-jest": "^29.*",
|
|
78
|
+
"jest": "^29.*"
|
|
70
79
|
}
|
|
71
80
|
}
|
|
@@ -3,7 +3,7 @@ import WtContextMenu from '../wt-context-menu.vue';
|
|
|
3
3
|
|
|
4
4
|
describe('WtContextMenu', () => {
|
|
5
5
|
it('renders a component', () => {
|
|
6
|
-
const wrapper = shallowMount(WtContextMenu, {
|
|
6
|
+
const wrapper = shallowMount(WtContextMenu, { props: { options: [] } });
|
|
7
7
|
expect(wrapper.classes('wt-context-menu')).toBe(true);
|
|
8
8
|
});
|
|
9
9
|
});
|
|
@@ -4,7 +4,7 @@ import WtIcon from '../wt-icon.vue';
|
|
|
4
4
|
describe('WtIcon', () => {
|
|
5
5
|
it('renders a component', () => {
|
|
6
6
|
const wrapper = shallowMount(WtIcon, {
|
|
7
|
-
|
|
7
|
+
props: {
|
|
8
8
|
icon: 'icon-name',
|
|
9
9
|
},
|
|
10
10
|
});
|
|
@@ -13,7 +13,7 @@ describe('WtIcon', () => {
|
|
|
13
13
|
it('correctly computes icon name', () => {
|
|
14
14
|
const iconName = '#jest-bucket';
|
|
15
15
|
const wrapper = shallowMount(WtIcon, {
|
|
16
|
-
|
|
16
|
+
props: {
|
|
17
17
|
icon: 'bucket',
|
|
18
18
|
size: 'sm',
|
|
19
19
|
iconPrefix: 'jest',
|
|
@@ -10,7 +10,7 @@ describe('WtIndicator', () => {
|
|
|
10
10
|
it('renders a component text, if passed', () => {
|
|
11
11
|
const content = 'Hello there!';
|
|
12
12
|
const wrapper = shallowMount(WtIndicator, {
|
|
13
|
-
|
|
13
|
+
props: {
|
|
14
14
|
text: content,
|
|
15
15
|
},
|
|
16
16
|
});
|
|
@@ -19,7 +19,7 @@ describe('WtIndicator', () => {
|
|
|
19
19
|
|
|
20
20
|
it('changed indicator color, if prop is passed', () => {
|
|
21
21
|
const wrapper = shallowMount(WtIndicator, {
|
|
22
|
-
|
|
22
|
+
props: {
|
|
23
23
|
color: 'primary',
|
|
24
24
|
},
|
|
25
25
|
});
|
|
@@ -3,7 +3,7 @@ import WtRoundedAction from '../wt-rounded-action.vue';
|
|
|
3
3
|
|
|
4
4
|
describe('WtRoundedAction', () => {
|
|
5
5
|
it('renders a component', () => {
|
|
6
|
-
const wrapper = shallowMount(WtRoundedAction, {
|
|
6
|
+
const wrapper = shallowMount(WtRoundedAction, { props: { icon: 'call' } });
|
|
7
7
|
expect(wrapper.classes('wt-rounded-action')).toBe(true);
|
|
8
8
|
});
|
|
9
9
|
});
|
package/src/components/index.js
CHANGED
|
@@ -21,7 +21,7 @@ describe('WtCheckbox', () => {
|
|
|
21
21
|
WtLabel,
|
|
22
22
|
WtIcon,
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
props: { label },
|
|
25
25
|
});
|
|
26
26
|
expect(wrapper.find('.wt-checkbox__label').text()).toBe(label);
|
|
27
27
|
});
|
|
@@ -33,7 +33,7 @@ describe('WtCheckbox', () => {
|
|
|
33
33
|
WtLabel,
|
|
34
34
|
WtIcon,
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
props: { selected },
|
|
37
37
|
});
|
|
38
38
|
wrapper.find('.wt-checkbox__input').trigger('change');
|
|
39
39
|
expect(wrapper.emitted().change[0]).toEqual([!selected]);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { shallowMount, mount
|
|
1
|
+
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
2
|
import FloatingVue, { Dropdown, Popper } from 'floating-vue';
|
|
3
3
|
import WtDatetimepicker from '../wt-datetimepicker.vue';
|
|
4
4
|
import WtLabel from '../../wt-label/wt-label.vue';
|
|
5
5
|
import WtIcon from '../../../atoms/wt-icon/wt-icon.vue';
|
|
6
6
|
import WtButton from '../../../atoms/wt-button/wt-button.vue';
|
|
7
7
|
|
|
8
|
-
const localVue = createLocalVue();
|
|
9
|
-
localVue.use(FloatingVue);
|
|
10
|
-
|
|
11
8
|
describe('WtDatetimepicker', () => {
|
|
12
9
|
it('renders a component', () => {
|
|
13
10
|
const wrapper = shallowMount(WtDatetimepicker, {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
global: {
|
|
12
|
+
plugins: [FloatingVue],
|
|
13
|
+
stubs: {
|
|
14
|
+
WtLabel,
|
|
15
|
+
WtIcon,
|
|
16
|
+
WtButton,
|
|
17
|
+
WtTimepicker: true,
|
|
18
|
+
},
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
21
|
expect(wrapper.classes('wt-datetimepicker')).toBe(true);
|
|
@@ -23,14 +23,17 @@ describe('WtDatetimepicker', () => {
|
|
|
23
23
|
|
|
24
24
|
it('renders label text when passed', () => {
|
|
25
25
|
const label = 'Hello there';
|
|
26
|
-
const wrapper =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const wrapper = mount(WtDatetimepicker, {
|
|
27
|
+
global: {
|
|
28
|
+
plugins: [FloatingVue],
|
|
29
|
+
stubs: {
|
|
30
|
+
WtLabel,
|
|
31
|
+
WtIcon,
|
|
32
|
+
WtButton,
|
|
33
|
+
WtTimepicker: true,
|
|
34
|
+
},
|
|
32
35
|
},
|
|
33
|
-
|
|
36
|
+
props: { label },
|
|
34
37
|
});
|
|
35
38
|
expect(wrapper.find('.wt-label').text()).toBe(label);
|
|
36
39
|
});
|
|
@@ -62,7 +65,7 @@ describe('WtDatetimepicker', () => {
|
|
|
62
65
|
// VDropdown: Dropdown,
|
|
63
66
|
// WtTimepicker: true,
|
|
64
67
|
// },
|
|
65
|
-
//
|
|
68
|
+
// props: {
|
|
66
69
|
// value: now,
|
|
67
70
|
// },
|
|
68
71
|
// });
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
:min="numberMin"
|
|
31
31
|
:placeholder="placeholder || label"
|
|
32
32
|
:type="inputType"
|
|
33
|
-
:value="value"
|
|
33
|
+
:value="value || modelValue"
|
|
34
34
|
class="wt-input__input"
|
|
35
|
-
|
|
35
|
+
@input="inputHandler"
|
|
36
36
|
>
|
|
37
37
|
<div
|
|
38
38
|
ref="after-wrapper"
|
|
@@ -72,10 +72,14 @@ export default {
|
|
|
72
72
|
name: 'wt-input',
|
|
73
73
|
mixins: [validationMixin],
|
|
74
74
|
props: {
|
|
75
|
+
value: {
|
|
76
|
+
type: [String, Number],
|
|
77
|
+
default: '',
|
|
78
|
+
},
|
|
75
79
|
/**
|
|
76
|
-
* Current input
|
|
80
|
+
* Current input modelValue (`v-model`)
|
|
77
81
|
*/
|
|
78
|
-
|
|
82
|
+
modelValue: {
|
|
79
83
|
type: [String, Number],
|
|
80
84
|
default: '',
|
|
81
85
|
},
|
|
@@ -155,7 +159,7 @@ export default {
|
|
|
155
159
|
description: 'Object with props, passed down to wt-label as props',
|
|
156
160
|
},
|
|
157
161
|
},
|
|
158
|
-
|
|
162
|
+
emits: ['update:modelValue', 'input'],
|
|
159
163
|
data: () => ({
|
|
160
164
|
inputType: '',
|
|
161
165
|
isPasswordVisible: false,
|
|
@@ -199,16 +203,10 @@ export default {
|
|
|
199
203
|
showPasswordIcon() {
|
|
200
204
|
return this.isPasswordVisible ? 'eye--closed' : 'eye--opened';
|
|
201
205
|
},
|
|
202
|
-
|
|
203
|
-
listeners() {
|
|
204
|
-
return {
|
|
205
|
-
...this.$listeners,
|
|
206
|
-
input: this.inputHandler,
|
|
207
|
-
};
|
|
208
|
-
},
|
|
209
206
|
},
|
|
210
207
|
methods: {
|
|
211
208
|
inputHandler(event) {
|
|
209
|
+
this.$emit('update:modelValue', event.target.value.trim());
|
|
212
210
|
this.$emit('input', event.target.value.trim());
|
|
213
211
|
},
|
|
214
212
|
|
|
@@ -7,11 +7,11 @@ describe('WtProgressBar', () => {
|
|
|
7
7
|
expect(wrapper.exists()).toBe(true);
|
|
8
8
|
});
|
|
9
9
|
it('isOverflow correctly computes overflow=true', () => {
|
|
10
|
-
const wrapper = shallowMount(WtProgressBar, {
|
|
10
|
+
const wrapper = shallowMount(WtProgressBar, { props: { value: 2, max: 1 } });
|
|
11
11
|
expect(wrapper.vm.isOverflow).toBe(true);
|
|
12
12
|
});
|
|
13
13
|
it('isOverflow correctly computes overflow=false', () => {
|
|
14
|
-
const wrapper = shallowMount(WtProgressBar, {
|
|
14
|
+
const wrapper = shallowMount(WtProgressBar, { props: { value: 0.99, max: 1 } });
|
|
15
15
|
expect(wrapper.vm.isOverflow).toBe(false);
|
|
16
16
|
});
|
|
17
17
|
});
|
|
@@ -21,7 +21,7 @@ describe('WtRadio', () => {
|
|
|
21
21
|
WtLabel,
|
|
22
22
|
WtIcon,
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
props: { label },
|
|
25
25
|
});
|
|
26
26
|
expect(wrapper.find('.wt-radio__label').text()).toBe(label);
|
|
27
27
|
});
|
|
@@ -34,7 +34,7 @@ describe('WtRadio', () => {
|
|
|
34
34
|
WtLabel,
|
|
35
35
|
WtIcon,
|
|
36
36
|
},
|
|
37
|
-
|
|
37
|
+
props: { selected, value },
|
|
38
38
|
});
|
|
39
39
|
wrapper.find('.wt-radio__input').trigger('input');
|
|
40
40
|
expect(wrapper.emitted().input[0]).toEqual([value]);
|
|
@@ -15,7 +15,7 @@ describe('MultiselectMixin', () => {
|
|
|
15
15
|
it('Correctly computes internal search options', () => {
|
|
16
16
|
const options = ['1', '2'];
|
|
17
17
|
const wrapper = shallowMount(Component, {
|
|
18
|
-
|
|
18
|
+
props: { options },
|
|
19
19
|
});
|
|
20
20
|
expect(wrapper.vm.selectOptions).toBe(options);
|
|
21
21
|
});
|
|
@@ -24,7 +24,7 @@ describe('MultiselectMixin', () => {
|
|
|
24
24
|
const options = ['1', '2'];
|
|
25
25
|
const searchOptions = ['1'];
|
|
26
26
|
const wrapper = shallowMount(Component, {
|
|
27
|
-
|
|
27
|
+
props: { options, searchMethod: () => ({ items: searchOptions }) },
|
|
28
28
|
});
|
|
29
29
|
await wrapper.vm.$nextTick();
|
|
30
30
|
expect(wrapper.vm.selectOptions).toBe(searchOptions);
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
:options="selectOptions"
|
|
32
32
|
:placeholder="placeholder || label"
|
|
33
33
|
:track-by="trackBy"
|
|
34
|
-
:value="selectValue"
|
|
34
|
+
:model-value="selectValue"
|
|
35
35
|
class="wt-select__select"
|
|
36
36
|
v-bind="$attrs"
|
|
37
37
|
@close="isOpened = false"
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
45
|
<!-- Slot that is used for all selected options (tags)-->
|
|
46
|
-
<template slot
|
|
46
|
+
<template v-slot:tag="{ option }">
|
|
47
47
|
<span class="multiselect__custom-tag">
|
|
48
48
|
{{ getOptionLabel({ option, optionLabel }) }}
|
|
49
49
|
</span>
|
|
50
50
|
</template>
|
|
51
51
|
|
|
52
52
|
<!-- Slot for custom label template for single select-->
|
|
53
|
-
<template slot
|
|
53
|
+
<template v-slot:singleLabel="{ option }">
|
|
54
54
|
<slot name="singleLabel" v-bind="{ option, optionLabel }">
|
|
55
55
|
<span class="multiselect__single-label">
|
|
56
56
|
{{ getOptionLabel({ option, optionLabel }) }}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</template>
|
|
60
60
|
|
|
61
61
|
<!-- Slot for custom option template -->
|
|
62
|
-
<template slot
|
|
62
|
+
<template v-slot:option="{ option }">
|
|
63
63
|
<slot name="option" v-bind="{ option, optionLabel }">
|
|
64
64
|
{{ getOptionLabel({ option, optionLabel }) }}
|
|
65
65
|
</slot>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
</template>
|
|
78
78
|
|
|
79
79
|
<!-- Slot located before the tags -->
|
|
80
|
-
<template slot
|
|
80
|
+
<template v-slot:clear="{}">
|
|
81
81
|
<wt-icon-btn
|
|
82
82
|
v-if="clearable"
|
|
83
83
|
:class="{ 'hidden': !isValue }"
|
|
@@ -14,7 +14,7 @@ describe('WtSwitcher', () => {
|
|
|
14
14
|
const label = 'Hello there';
|
|
15
15
|
const wrapper = shallowMount(WtSwitcher, {
|
|
16
16
|
stubs: { WtLabel },
|
|
17
|
-
|
|
17
|
+
props: { label },
|
|
18
18
|
});
|
|
19
19
|
expect(wrapper.find('.wt-switcher__label').text()).toBe(label);
|
|
20
20
|
});
|
|
@@ -23,7 +23,7 @@ describe('WtSwitcher', () => {
|
|
|
23
23
|
const value = true;
|
|
24
24
|
const wrapper = shallowMount(WtSwitcher, {
|
|
25
25
|
stubs: { WtLabel },
|
|
26
|
-
|
|
26
|
+
props: { value },
|
|
27
27
|
});
|
|
28
28
|
wrapper.find('.wt-switcher__input').trigger('change');
|
|
29
29
|
expect(wrapper.emitted().change[0]).toEqual([!value]);
|
|
@@ -10,7 +10,7 @@ describe('WtTabs', () => {
|
|
|
10
10
|
|
|
11
11
|
it('component emits change at tab click', () => {
|
|
12
12
|
const wrapper = shallowMount(WtTabs, {
|
|
13
|
-
|
|
13
|
+
props: { tabs },
|
|
14
14
|
});
|
|
15
15
|
wrapper.find('.wt-tab').trigger('click');
|
|
16
16
|
expect(wrapper.emitted().change.pop()).toEqual([tabs[0]]);
|
|
@@ -18,7 +18,7 @@ describe('WtTabs', () => {
|
|
|
18
18
|
|
|
19
19
|
it('renders tab default content', () => {
|
|
20
20
|
const wrapper = shallowMount(WtTabs, {
|
|
21
|
-
|
|
21
|
+
props: { tabs },
|
|
22
22
|
});
|
|
23
23
|
expect(wrapper.find('.wt-tab').text()).toBe(tabs[0].text);
|
|
24
24
|
});
|
|
@@ -26,7 +26,7 @@ describe('WtTabs', () => {
|
|
|
26
26
|
it('renders tab custom content via default slot', () => {
|
|
27
27
|
const custom = 'custom name';
|
|
28
28
|
const wrapper = shallowMount(WtTabs, {
|
|
29
|
-
|
|
29
|
+
props: { tabs },
|
|
30
30
|
slots: {
|
|
31
31
|
tab1: custom,
|
|
32
32
|
},
|
|
@@ -12,7 +12,7 @@ describe('WtTagsInput', () => {
|
|
|
12
12
|
const label = 'Hello there';
|
|
13
13
|
const wrapper = shallowMount(WtTagsInput, {
|
|
14
14
|
stubs: { WtLabel },
|
|
15
|
-
|
|
15
|
+
props: { label },
|
|
16
16
|
});
|
|
17
17
|
expect(wrapper.find('.wt-label').text()).toBe(label);
|
|
18
18
|
});
|
|
@@ -20,7 +20,7 @@ describe('WtTagsInput', () => {
|
|
|
20
20
|
it('by default emits "input" event at native "tag" event', () => {
|
|
21
21
|
const tag = '123';
|
|
22
22
|
const wrapper = shallowMount(WtTagsInput, {
|
|
23
|
-
|
|
23
|
+
props: {
|
|
24
24
|
value: [],
|
|
25
25
|
},
|
|
26
26
|
});
|
|
@@ -31,7 +31,7 @@ describe('WtTagsInput', () => {
|
|
|
31
31
|
it('in manual mode doesnt emit "input" event at native "tag" event', () => {
|
|
32
32
|
const tag = '123';
|
|
33
33
|
const wrapper = shallowMount(WtTagsInput, {
|
|
34
|
-
|
|
34
|
+
props: {
|
|
35
35
|
value: [],
|
|
36
36
|
manualTagging: true,
|
|
37
37
|
},
|
|
@@ -18,7 +18,7 @@ describe('WtTextarea', () => {
|
|
|
18
18
|
stubs: {
|
|
19
19
|
WtLabel,
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
props: { label },
|
|
22
22
|
});
|
|
23
23
|
expect(wrapper.find('.wt-label').text()).toBe(label);
|
|
24
24
|
});
|
|
@@ -28,7 +28,7 @@ describe('WtTextarea', () => {
|
|
|
28
28
|
stubs: {
|
|
29
29
|
WtLabel,
|
|
30
30
|
},
|
|
31
|
-
|
|
31
|
+
props: { chatMode: true },
|
|
32
32
|
});
|
|
33
33
|
wrapper.find('.wt-textarea__textarea').trigger('keypress', { key: 'Enter' });
|
|
34
34
|
expect(wrapper.emitted().enter).toBeTruthy();
|
|
@@ -17,7 +17,7 @@ describe('WtTimepicker', () => {
|
|
|
17
17
|
stubs: {
|
|
18
18
|
WtTimeInput,
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
props: { format: 'mm' },
|
|
21
21
|
});
|
|
22
22
|
expect(wrapper.findAllComponents(WtTimeInput).length).toBe(1);
|
|
23
23
|
});
|
|
@@ -28,7 +28,7 @@ describe('WtTimepicker', () => {
|
|
|
28
28
|
stubs: {
|
|
29
29
|
WtTimeInput,
|
|
30
30
|
},
|
|
31
|
-
|
|
31
|
+
props: { value },
|
|
32
32
|
});
|
|
33
33
|
wrapper.findAllComponents(WtTimeInput).at(0).vm.$emit('input', 21);
|
|
34
34
|
expect(wrapper.emitted().input[0]).toEqual([21 * 60 * 60]);
|
|
@@ -40,7 +40,7 @@ describe('WtTimepicker', () => {
|
|
|
40
40
|
stubs: {
|
|
41
41
|
WtTimeInput,
|
|
42
42
|
},
|
|
43
|
-
|
|
43
|
+
props: { value },
|
|
44
44
|
});
|
|
45
45
|
wrapper.findAllComponents(WtTimeInput).at(1).vm.$emit('input', 21);
|
|
46
46
|
expect(wrapper.emitted().input[0]).toEqual([21 * 60]);
|
|
@@ -52,7 +52,7 @@ describe('WtTimepicker', () => {
|
|
|
52
52
|
stubs: {
|
|
53
53
|
WtTimeInput,
|
|
54
54
|
},
|
|
55
|
-
|
|
55
|
+
props: { value },
|
|
56
56
|
});
|
|
57
57
|
wrapper.findAllComponents(WtTimeInput).at(2).vm.$emit('input', 21);
|
|
58
58
|
expect(wrapper.emitted().input[0]).toEqual([21]);
|
|
@@ -13,7 +13,7 @@ describe('WtHeaderActions', () => {
|
|
|
13
13
|
account: 'acc@ou.nt',
|
|
14
14
|
};
|
|
15
15
|
const wrapper = shallowMount(WtHeaderActions, {
|
|
16
|
-
|
|
16
|
+
props: { user },
|
|
17
17
|
});
|
|
18
18
|
expect(wrapper.find('.wt-header-actions__name').text()).toBe(user.name);
|
|
19
19
|
expect(wrapper.find('.wt-header-actions__account').text()).toBe(user.account);
|
|
@@ -3,15 +3,15 @@ import ErrorPage from '../wt-error-page.vue';
|
|
|
3
3
|
|
|
4
4
|
describe('Error Page', () => {
|
|
5
5
|
it('renders a component', () => {
|
|
6
|
-
const wrapper = shallowMount(ErrorPage, {
|
|
6
|
+
const wrapper = shallowMount(ErrorPage, { props: { type: '' } });
|
|
7
7
|
expect(wrapper.exists()).toBe(true);
|
|
8
8
|
});
|
|
9
9
|
it('renders a component with 404 type', () => {
|
|
10
|
-
const wrapper = shallowMount(ErrorPage, {
|
|
10
|
+
const wrapper = shallowMount(ErrorPage, { props: { type: '404' } });
|
|
11
11
|
expect(wrapper.exists()).toBe(true);
|
|
12
12
|
});
|
|
13
13
|
it('renders a component with 403 type', () => {
|
|
14
|
-
const wrapper = shallowMount(ErrorPage, {
|
|
14
|
+
const wrapper = shallowMount(ErrorPage, { props: { type: '403' } });
|
|
15
15
|
expect(wrapper.exists()).toBe(true);
|
|
16
16
|
});
|
|
17
17
|
});
|