@webitel/ui-sdk 26.8.75 → 26.8.76
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/{clients-BmeOR90W.js → clients-oFIeYM2J.js} +66 -79
- package/dist/{components-C-ri6OSQ.js → components-BG2hOYak.js} +11 -11
- package/dist/{enums-BvonmHq2.js → enums-B_9ZBu01.js} +2 -2
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +3 -3
- package/dist/ui-sdk.umd.cjs +574 -574
- package/dist/{useValidation-0JwQGpLM.js → useValidation-CEed9cxY.js} +1 -1
- package/dist/{utils-CzBdLnFt.js → utils-BZHq8qMH.js} +1 -1
- package/dist/wt-action-bar-D74sgDCk.js +94 -0
- package/dist/{wt-button-D-nFhi1f.js → wt-button-CVjzcwNg.js} +2 -2
- package/dist/{wt-chat-emoji-CLhgb02d.js → wt-chat-emoji-CP1IO0Z_.js} +4 -4
- package/dist/{wt-datepicker-DCa23hYx.js → wt-datepicker-BgjjbOMX.js} +2 -2
- package/dist/{wt-display-chip-items-B7QLz9QM.js → wt-display-chip-items-BcuWCOui.js} +2 -2
- package/dist/{wt-dual-panel-D-LChluY.js → wt-dual-panel-Cs_Yzfxt.js} +1 -1
- package/dist/{wt-expansion-card-CToBA1fy.js → wt-expansion-card-BT586Mul.js} +1 -1
- package/dist/{wt-expansion-panel-af2t3VrM.js → wt-expansion-panel-kZmHSvPU.js} +1 -1
- package/dist/{wt-icon-WyFAGc4t.js → wt-icon-CAn_j3EL.js} +1 -1
- package/dist/{wt-icon-action-DYBTs3Mf.js → wt-icon-action-DJzm0kEk.js} +1 -1
- package/dist/{wt-icon-btn-BfhuUt8-.js → wt-icon-btn-BL0OfOZM.js} +1 -1
- package/dist/{wt-notifications-bar-CvKwuTEg.js → wt-notifications-bar-DZUTZhZy.js} +2 -2
- package/dist/{wt-player-B2etfN5v.js → wt-player-DbQuCEZb.js} +3 -3
- package/dist/{wt-screen-recordings-action-CepB2pqh.js → wt-screen-recordings-action-CVHZAWjl.js} +1 -1
- package/dist/{wt-search-bar-B4YkhgIB.js → wt-search-bar-DosqJLXT.js} +1 -1
- package/dist/{wt-send-message-popup-BhZ7K_Vs.js → wt-send-message-popup-B59bhE16.js} +2 -2
- package/dist/{wt-status-select-ELI7j73g.js → wt-status-select-Dnv9tj7o.js} +1 -1
- package/dist/{wt-timepicker-C3v9Cp2e.js → wt-timepicker-B4MOaSEZ.js} +2 -2
- package/dist/{wt-toast-DxQBRGm2.js → wt-toast-DJJg7o3S.js} +2 -2
- package/dist/{wt-tree-table-C5sxm-Eb.js → wt-tree-table-D-Jzijlk.js} +1 -1
- package/dist/{wt-type-extension-value-input-gQGgxMcJ.js → wt-type-extension-value-input-BEfx2uDx.js} +3 -3
- package/dist/{wt-vidstack-player-B37Mdf0u.js → wt-vidstack-player-efSk6APE.js} +4 -4
- package/package.json +1 -1
- package/src/components/transitions/__tests__/ExpandTransition.spec.js +15 -0
- package/src/components/transitions/__tests__/WtReplaceTransition.spec.js +66 -0
- package/src/components/transitions/__tests__/WtTransition.spec.js +35 -0
- package/src/components/wt-action-bar/WtActionBarActionsOrder.js +1 -1
- package/src/components/wt-action-bar/__tests__/WtActionBar.spec.js +121 -0
- package/src/components/wt-action-bar/wt-action-bar.vue +57 -33
- package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +65 -4
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +81 -2
- package/src/components/wt-avatar/__tests__/WtAvatar.spec.js +111 -0
- package/src/components/wt-badge/__tests__/WtBadge.spec.js +80 -0
- package/src/components/wt-badge-new/__tests__/WtBadge.spec.js +61 -0
- package/src/components/wt-breadcrumb/__tests__/WtBreadcrumb.spec.js +117 -0
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +37 -5
- package/src/components/wt-call-media-metric/__tests__/WtCallMediaMetric.spec.js +84 -0
- package/src/components/wt-card/__tests__/WtCard.spec.js +20 -0
- package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +63 -0
- package/src/components/wt-chip/__tests__/WtChip.spec.js +32 -0
- package/src/components/wt-confirm-dialog/__tests__/WtConfirmDialog.spec.js +92 -0
- package/src/components/wt-context-menu/__tests__/WtContextMenu.spec.js +146 -1
- package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +57 -0
- package/src/components/wt-datepicker/__tests__/WtDatepicker.spec.js +53 -0
- package/src/components/wt-datetime-text/__tests__/WtDatetimeText.spec.js +49 -0
- package/src/components/wt-divider/__tests__/WtDivider.spec.js +30 -0
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.spec.js +120 -0
- package/src/components/wt-dummy/__tests__/WtDummy.spec.js +63 -1
- package/src/components/wt-empty/__tests__/WtEmpty.spec.js +84 -0
- package/src/components/wt-error-page/__tests__/WtErrorPage.spec.js +60 -0
- package/src/components/wt-expansion-card/__tests__/WtExpansionCard.spec.js +63 -0
- package/src/components/wt-expansion-panel/__tests__/WtExpansionPanel.spec.js +48 -9
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +81 -10
- package/src/components/wt-hint/__tests__/WtHint.spec.js +44 -1
- package/src/components/wt-icon/__tests__/WtIcon.spec.js +29 -0
- package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +79 -0
- package/src/components/wt-icon-action/wt-icon-action.vue +1 -1
- package/src/components/wt-icon-btn/__tests__/WtIconBtn.spec.js +46 -0
- package/src/components/wt-image/__tests__/WtImage.spec.js +83 -0
- package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +23 -0
- package/src/components/wt-input-number/__tests__/WtInputNumber.spec.js +77 -0
- package/src/components/wt-input-text/__tests__/WtInputText.spec.js +85 -0
- package/src/components/wt-intersection-observer/__tests__/WtIntersectionObserver.spec.js +24 -3
- package/src/components/wt-item-link/__tests__/WtItemLink.spec.js +93 -1
- package/src/components/wt-label/__tests__/WtLabel.spec.js +49 -1
- package/src/components/wt-load-bar/__tests__/WtLoadBar.spec.js +49 -0
- package/src/components/wt-loader/__tests__/WtLoader.spec.js +26 -1
- package/src/components/wt-logo/__tests__/WtLogo.spec.js +55 -0
- package/src/components/wt-menubar/__tests__/WtMenubar.spec.js +30 -0
- package/src/components/wt-message/__tests__/WtMessage.spec.js +46 -0
- package/src/components/wt-multi-select/__tests__/WtMultiSelect.spec.js +106 -0
- package/src/components/wt-page-header/__tests__/WtPageHeader.spec.js +111 -0
- package/src/components/wt-password/__tests__/WtPassword.spec.js +107 -0
- package/src/components/wt-popover/__tests__/WtPopover.spec.js +73 -0
- package/src/components/wt-progress-bar/__tests__/WtProgressBar.spec.js +34 -0
- package/src/components/wt-radio/__tests__/WtRadio.spec.js +45 -0
- package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +48 -0
- package/src/components/wt-search-bar/__tests__/WtSearchBar.spec.js +74 -13
- package/src/components/wt-single-select/__tests__/WtSingleSelect.spec.js +117 -0
- package/src/components/wt-slider/__tests__/WtSlider.spec.js +100 -0
- package/src/components/wt-stepper/__tests__/WtStepper.spec.js +105 -0
- package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +47 -0
- package/src/components/wt-table/__tests__/WtTable.spec.js +237 -0
- package/src/components/wt-table-actions/__tests__/WtTableActions.spec.js +153 -1
- package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +147 -0
- package/src/components/wt-tabs/__tests__/WtTabs.spec.js +55 -0
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +49 -0
- package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +29 -0
- package/src/components/wt-tree/__tests__/WtTree.spec.js +126 -2
- package/src/components/wt-tree-line/__tests__/WtTreeLine.spec.js +205 -0
- package/src/components/wt-tree-table/__tests__/WtTreeTable.spec.js +155 -0
- package/src/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.js +176 -0
- package/src/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.js +82 -0
- package/src/enums/IconAction/{IconAction.enum.js → IconAction.ts} +4 -2
- package/src/enums/index.ts +1 -1
- package/src/modules/ObjectPermissions/components/_internal/permissions-tab-content.vue +1 -1
- package/types/.tsbuildinfo +1 -1
- package/types/components/wt-action-bar/wt-action-bar.vue.d.ts +349 -105
- package/types/components/wt-datetime-text/__tests__/WtDatetimeText.spec.d.ts +1 -0
- package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +1 -0
- package/types/components/wt-dual-panel/__tests__/WtDualPanel.spec.d.ts +1 -0
- package/types/components/wt-empty/__tests__/WtEmpty.spec.d.ts +1 -0
- package/types/components/wt-error-page/__tests__/WtErrorPage.spec.d.ts +1 -0
- package/types/components/wt-expansion-card/__tests__/WtExpansionCard.spec.d.ts +1 -0
- package/types/components/wt-image/__tests__/WtImage.spec.d.ts +1 -0
- package/types/components/wt-input-number/__tests__/WtInputNumber.spec.d.ts +1 -0
- package/types/components/wt-input-text/__tests__/WtInputText.spec.d.ts +1 -0
- package/types/components/wt-logo/__tests__/WtLogo.spec.d.ts +1 -0
- package/types/components/wt-menubar/__tests__/WtMenubar.spec.d.ts +1 -0
- package/types/components/wt-message/__tests__/WtMessage.spec.d.ts +1 -0
- package/types/components/wt-multi-select/__tests__/WtMultiSelect.spec.d.ts +1 -0
- package/types/components/wt-page-header/__tests__/WtPageHeader.spec.d.ts +1 -0
- package/types/components/wt-password/__tests__/WtPassword.spec.d.ts +1 -0
- package/types/components/wt-popover/__tests__/WtPopover.spec.d.ts +1 -0
- package/types/components/wt-single-select/__tests__/WtSingleSelect.spec.d.ts +1 -0
- package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +1 -0
- package/types/components/wt-stepper/__tests__/WtStepper.spec.d.ts +1 -0
- package/types/components/wt-table/__tests__/WtTable.spec.d.ts +1 -0
- package/types/components/wt-tree-line/__tests__/WtTreeLine.spec.d.ts +1 -0
- package/types/components/wt-tree-table/__tests__/WtTreeTable.spec.d.ts +1 -0
- package/types/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.d.ts +1 -0
- package/types/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.d.ts +1 -0
- package/types/enums/IconAction/IconAction.d.ts +31 -0
- package/types/enums/index.d.ts +1 -1
- package/dist/wt-action-bar-D4wDtBqb.js +0 -87
- package/src/components/wt-action-bar/__tests__/wt-action-bar.spec.js +0 -10
- package/src/components/wt-avatar/__tests__/wt-avatar.spec.js +0 -10
- package/src/components/wt-badge/__tests__/wt-badge.spec.js +0 -10
- package/src/components/wt-breadcrumb/__tests__/wt-breadcrumb.spec.js +0 -14
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.js +0 -62
- package/src/components/wt-empty/__tests__/wt-empty.spec.js +0 -10
- package/src/components/wt-error-page/__tests__/wt-error-page.spec.js +0 -30
- package/src/components/wt-image/__tests__/wt-image.spec.js +0 -10
- package/src/components/wt-logo/__tests__/wt-logo.spec.js +0 -10
- package/src/components/wt-page-header/__tests__/wt-page-header.spec.js +0 -10
- package/src/components/wt-stepper/__tests__/WtStepper.spec.vue.js +0 -19
- package/types/enums/IconAction/IconAction.enum.d.ts +0 -30
- /package/types/components/{wt-action-bar/__tests__/wt-action-bar.spec.d.ts → transitions/__tests__/WtReplaceTransition.spec.d.ts} +0 -0
- /package/types/components/{wt-avatar/__tests__/wt-avatar.spec.d.ts → transitions/__tests__/WtTransition.spec.d.ts} +0 -0
- /package/types/components/{wt-badge/__tests__/wt-badge.spec.d.ts → wt-action-bar/__tests__/WtActionBar.spec.d.ts} +0 -0
- /package/types/components/{wt-breadcrumb/__tests__/wt-breadcrumb.spec.d.ts → wt-avatar/__tests__/WtAvatar.spec.d.ts} +0 -0
- /package/types/components/{wt-empty/__tests__/wt-empty.spec.d.ts → wt-badge/__tests__/WtBadge.spec.d.ts} +0 -0
- /package/types/components/{wt-dual-panel/__tests__/WtDualPanel.d.ts → wt-badge-new/__tests__/WtBadge.spec.d.ts} +0 -0
- /package/types/components/{wt-error-page/__tests__/wt-error-page.spec.d.ts → wt-breadcrumb/__tests__/WtBreadcrumb.spec.d.ts} +0 -0
- /package/types/components/{wt-image/__tests__/wt-image.spec.d.ts → wt-call-media-metric/__tests__/WtCallMediaMetric.spec.d.ts} +0 -0
- /package/types/components/{wt-logo/__tests__/wt-logo.spec.d.ts → wt-card/__tests__/WtCard.spec.d.ts} +0 -0
- /package/types/components/{wt-page-header/__tests__/wt-page-header.spec.d.ts → wt-confirm-dialog/__tests__/WtConfirmDialog.spec.d.ts} +0 -0
- /package/types/components/{wt-stepper/__tests__/WtStepper.spec.vue.d.ts → wt-copy-action/__tests__/WtCopyAction.spec.d.ts} +0 -0
|
@@ -28,4 +28,57 @@ describe('WtDatepicker', () => {
|
|
|
28
28
|
});
|
|
29
29
|
expect(wrapper.find('.wt-label').text()).toBe(label);
|
|
30
30
|
});
|
|
31
|
+
|
|
32
|
+
it('appends an asterisk to the label when required', () => {
|
|
33
|
+
const label = 'Hello there';
|
|
34
|
+
const wrapper = mount(WtDatepicker, {
|
|
35
|
+
stubs: {
|
|
36
|
+
WtLabel,
|
|
37
|
+
WtIcon,
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
label,
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
expect(wrapper.find('.wt-label').text()).toBe(`${label}*`);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('passes the disabled prop down to the underlying datepicker', () => {
|
|
48
|
+
const wrapper = shallowMount(WtDatepicker, {
|
|
49
|
+
stubs: {
|
|
50
|
+
WtLabel,
|
|
51
|
+
WtIcon,
|
|
52
|
+
},
|
|
53
|
+
props: {
|
|
54
|
+
disabled: true,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
expect(
|
|
58
|
+
wrapper
|
|
59
|
+
.findComponent({
|
|
60
|
+
name: 'DatePicker',
|
|
61
|
+
})
|
|
62
|
+
.attributes('disabled'),
|
|
63
|
+
).toBe('true');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('uses a default placeholder based on showTime', () => {
|
|
67
|
+
const wrapper = shallowMount(WtDatepicker, {
|
|
68
|
+
stubs: {
|
|
69
|
+
WtLabel,
|
|
70
|
+
WtIcon,
|
|
71
|
+
},
|
|
72
|
+
props: {
|
|
73
|
+
showTime: true,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
expect(
|
|
77
|
+
wrapper
|
|
78
|
+
.findComponent({
|
|
79
|
+
name: 'DatePicker',
|
|
80
|
+
})
|
|
81
|
+
.attributes('placeholder'),
|
|
82
|
+
).toBe('dd/mm/yyyy hh:mm');
|
|
83
|
+
});
|
|
31
84
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import { FormatDateMode } from '../../../enums';
|
|
4
|
+
import WtDatetimeText from '../wt-datetime-text.vue';
|
|
5
|
+
|
|
6
|
+
describe('WtDatetimeText', () => {
|
|
7
|
+
it('renders the datetime formatted in datetime mode by default', () => {
|
|
8
|
+
const wrapper = mount(WtDatetimeText, {
|
|
9
|
+
props: {
|
|
10
|
+
datetime: 1700000000000,
|
|
11
|
+
timezone: 'UTC',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
expect(wrapper.text()).toBe('14.11.2023, 22:13:20');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('renders using date mode', () => {
|
|
18
|
+
const wrapper = mount(WtDatetimeText, {
|
|
19
|
+
props: {
|
|
20
|
+
datetime: 1700000000000,
|
|
21
|
+
mode: FormatDateMode.DATE,
|
|
22
|
+
timezone: 'UTC',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
expect(wrapper.text()).toBe('14.11.2023');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('renders using time mode', () => {
|
|
29
|
+
const wrapper = mount(WtDatetimeText, {
|
|
30
|
+
props: {
|
|
31
|
+
datetime: 1700000000000,
|
|
32
|
+
mode: FormatDateMode.TIME,
|
|
33
|
+
timezone: 'UTC',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
expect(wrapper.text()).toBe('22:13');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders using a different timezone', () => {
|
|
40
|
+
const wrapper = mount(WtDatetimeText, {
|
|
41
|
+
props: {
|
|
42
|
+
datetime: 1700000000000,
|
|
43
|
+
mode: FormatDateMode.DATETIME_SHORT,
|
|
44
|
+
timezone: 'Europe/Kyiv',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
expect(wrapper.text()).toBe('15.11.2023, 0:13');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtDivider from '../wt-divider.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtDivider', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtDivider);
|
|
8
|
+
expect(
|
|
9
|
+
wrapper
|
|
10
|
+
.findComponent({
|
|
11
|
+
name: 'Divider',
|
|
12
|
+
})
|
|
13
|
+
.exists(),
|
|
14
|
+
).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('defaults to horizontal layout', () => {
|
|
18
|
+
const wrapper = shallowMount(WtDivider);
|
|
19
|
+
expect(wrapper.attributes('layout')).toBe('horizontal');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('passes a custom variant as the layout prop', () => {
|
|
23
|
+
const wrapper = shallowMount(WtDivider, {
|
|
24
|
+
props: {
|
|
25
|
+
variant: 'vertical',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
expect(wrapper.attributes('layout')).toBe('vertical');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import { ComponentSize } from '../../../enums';
|
|
4
|
+
import WtDualPanel from '../wt-dual-panel.vue';
|
|
5
|
+
|
|
6
|
+
describe('WtDualPanel', () => {
|
|
7
|
+
it('renders a component', () => {
|
|
8
|
+
const wrapper = shallowMount(WtDualPanel);
|
|
9
|
+
expect(wrapper.classes('wt-dual-panel')).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('renders dual panel header via header slot', () => {
|
|
13
|
+
const content = 'Dual Panel header';
|
|
14
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
15
|
+
slots: {
|
|
16
|
+
header: content,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
expect(wrapper.find('.wt-dual-panel__header').text()).toBe(content);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('does not render the header when hideHeader is true', () => {
|
|
23
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
24
|
+
props: {
|
|
25
|
+
hideHeader: true,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
expect(wrapper.find('.wt-dual-panel__header').exists()).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('renders dual panel actions panel via actions panel slot when actionsPanel prop is true', () => {
|
|
32
|
+
const content = 'Dual Panel actions panel content';
|
|
33
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
34
|
+
props: {
|
|
35
|
+
actionsPanel: true,
|
|
36
|
+
},
|
|
37
|
+
slots: {
|
|
38
|
+
'actions-panel': content,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
expect(wrapper.find('.wt-dual-panel__actions-panel').text()).toBe(content);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('does not render actions panel when actionsPanel prop is false', () => {
|
|
45
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
46
|
+
props: {
|
|
47
|
+
actionsPanel: false,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
expect(wrapper.find('.wt-dual-panel__actions-panel').exists()).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('renders dual panel side panel via side-panel slot', () => {
|
|
54
|
+
const content = 'Dual Panel side panel';
|
|
55
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
56
|
+
slots: {
|
|
57
|
+
'side-panel': content,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
expect(wrapper.find('.wt-dual-panel__side-panel').text()).toBe(content);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('renders dual panel main content via main slot', () => {
|
|
64
|
+
const content = 'Dual Panel main panel';
|
|
65
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
66
|
+
slots: {
|
|
67
|
+
main: content,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
expect(wrapper.find('.wt-dual-panel__main').text()).toBe(content);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('renders the resize icon action by default', () => {
|
|
74
|
+
const wrapper = shallowMount(WtDualPanel);
|
|
75
|
+
expect(
|
|
76
|
+
wrapper
|
|
77
|
+
.findComponent({
|
|
78
|
+
name: 'wt-icon-action',
|
|
79
|
+
})
|
|
80
|
+
.exists(),
|
|
81
|
+
).toBe(true);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('does not render the resize icon action when disableResize is true', () => {
|
|
85
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
86
|
+
props: {
|
|
87
|
+
disableResize: true,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
expect(
|
|
91
|
+
wrapper
|
|
92
|
+
.findComponent({
|
|
93
|
+
name: 'wt-icon-action',
|
|
94
|
+
})
|
|
95
|
+
.exists(),
|
|
96
|
+
).toBe(false);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('collapses the side panel and emits the new size when the resize action is clicked', async () => {
|
|
100
|
+
const content = 'side content';
|
|
101
|
+
const wrapper = shallowMount(WtDualPanel, {
|
|
102
|
+
slots: {
|
|
103
|
+
'side-panel': content,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
expect(wrapper.find('.wt-dual-panel__side-panel--md').exists()).toBe(true);
|
|
107
|
+
|
|
108
|
+
await wrapper
|
|
109
|
+
.findComponent({
|
|
110
|
+
name: 'wt-icon-action',
|
|
111
|
+
})
|
|
112
|
+
.vm.$emit('click');
|
|
113
|
+
|
|
114
|
+
expect(wrapper.find('.wt-dual-panel__side-panel--sm').exists()).toBe(true);
|
|
115
|
+
expect(wrapper.text()).not.toContain(content);
|
|
116
|
+
expect(wrapper.emitted()['update:side-panel-size'][0]).toEqual([
|
|
117
|
+
ComponentSize.SM,
|
|
118
|
+
]);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import WtDummy from '../wt-dummy.vue';
|
|
4
4
|
|
|
@@ -7,4 +7,66 @@ describe('WtDummy', () => {
|
|
|
7
7
|
const wrapper = shallowMount(WtDummy);
|
|
8
8
|
expect(wrapper.isVisible()).toBe(true);
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
it('renders default localized text when text prop is not passed', () => {
|
|
12
|
+
const wrapper = mount(WtDummy);
|
|
13
|
+
expect(wrapper.find('.wt-dummy__text').text()).toBe(
|
|
14
|
+
'There are no records yet',
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders custom text when passed', () => {
|
|
19
|
+
const wrapper = mount(WtDummy, {
|
|
20
|
+
props: {
|
|
21
|
+
text: 'Custom empty message',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
expect(wrapper.find('.wt-dummy__text').text()).toBe('Custom empty message');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('hides text when hiddenText is true', () => {
|
|
28
|
+
const wrapper = mount(WtDummy, {
|
|
29
|
+
props: {
|
|
30
|
+
hiddenText: true,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
expect(wrapper.find('.wt-dummy__text').exists()).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('does not render an action button by default', () => {
|
|
37
|
+
const wrapper = shallowMount(WtDummy);
|
|
38
|
+
expect(
|
|
39
|
+
wrapper
|
|
40
|
+
.findComponent({
|
|
41
|
+
name: 'wt-button',
|
|
42
|
+
})
|
|
43
|
+
.exists(),
|
|
44
|
+
).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('renders an action button and emits create when clicked', async () => {
|
|
48
|
+
const wrapper = shallowMount(WtDummy, {
|
|
49
|
+
props: {
|
|
50
|
+
showAction: true,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const button = wrapper.findComponent({
|
|
54
|
+
name: 'wt-button',
|
|
55
|
+
});
|
|
56
|
+
expect(button.exists()).toBe(true);
|
|
57
|
+
|
|
58
|
+
await button.vm.$emit('click');
|
|
59
|
+
expect(wrapper.emitted().create).toBeTruthy();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('uses the given size for the dummy image', () => {
|
|
63
|
+
const wrapper = mount(WtDummy, {
|
|
64
|
+
props: {
|
|
65
|
+
size: 100,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
const img = wrapper.find('.wt-dummy__img img');
|
|
69
|
+
expect(img.attributes('width')).toBe('100');
|
|
70
|
+
expect(img.attributes('height')).toBe('100');
|
|
71
|
+
});
|
|
10
72
|
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtEmpty from '../wt-empty.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtEmpty', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtEmpty);
|
|
8
|
+
expect(wrapper.exists()).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('does not render media/info/actions sections by default', () => {
|
|
12
|
+
const wrapper = shallowMount(WtEmpty);
|
|
13
|
+
expect(wrapper.find('.wt-empty__media').exists()).toBe(false);
|
|
14
|
+
expect(wrapper.find('.wt-empty__info').exists()).toBe(false);
|
|
15
|
+
expect(wrapper.find('.wt-empty__actions').exists()).toBe(false);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders media when image prop is provided', () => {
|
|
19
|
+
const wrapper = shallowMount(WtEmpty, {
|
|
20
|
+
props: {
|
|
21
|
+
image: 'image.svg',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
expect(wrapper.find('.wt-empty__media').exists()).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('renders headline, title and text when provided', () => {
|
|
28
|
+
const wrapper = mount(WtEmpty, {
|
|
29
|
+
props: {
|
|
30
|
+
headline: 'Headline',
|
|
31
|
+
title: 'Title',
|
|
32
|
+
text: 'Text',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
expect(wrapper.find('.wt-empty__headline').text()).toBe('Headline');
|
|
36
|
+
expect(wrapper.find('.wt-empty__title').text()).toBe('Title');
|
|
37
|
+
expect(wrapper.find('.wt-empty__text').text()).toBe('Text');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('renders primary and secondary action buttons and emits click handlers', async () => {
|
|
41
|
+
const wrapper = mount(WtEmpty, {
|
|
42
|
+
props: {
|
|
43
|
+
primaryActionText: 'Retry',
|
|
44
|
+
secondaryActionText: 'Cancel',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
const buttons = wrapper.findAllComponents({
|
|
48
|
+
name: 'wt-button',
|
|
49
|
+
});
|
|
50
|
+
expect(buttons.length).toBe(2);
|
|
51
|
+
expect(buttons[0].text()).toBe('Retry');
|
|
52
|
+
expect(buttons[1].text()).toBe('Cancel');
|
|
53
|
+
|
|
54
|
+
await buttons[0].trigger('click');
|
|
55
|
+
expect(wrapper.emitted()['click:primary']).toBeTruthy();
|
|
56
|
+
|
|
57
|
+
await buttons[1].trigger('click');
|
|
58
|
+
expect(wrapper.emitted()['click:secondary']).toBeTruthy();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('disables primary/secondary action buttons independently', () => {
|
|
62
|
+
const wrapper = shallowMount(WtEmpty, {
|
|
63
|
+
props: {
|
|
64
|
+
primaryActionText: 'Retry',
|
|
65
|
+
secondaryActionText: 'Cancel',
|
|
66
|
+
disabledPrimaryAction: true,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
const buttons = wrapper.findAllComponents({
|
|
70
|
+
name: 'wt-button',
|
|
71
|
+
});
|
|
72
|
+
expect(buttons[0].props('disabled')).toBe(true);
|
|
73
|
+
expect(buttons[1].props('disabled')).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('applies the size modifier class', () => {
|
|
77
|
+
const wrapper = shallowMount(WtEmpty, {
|
|
78
|
+
props: {
|
|
79
|
+
size: 'sm',
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
expect(wrapper.classes()).toContain('wt-empty--size-sm');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import ErrorPage from '../wt-error-page.vue';
|
|
4
|
+
|
|
5
|
+
describe('Error Page', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(ErrorPage, {
|
|
8
|
+
props: {
|
|
9
|
+
type: '',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
expect(wrapper.exists()).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('renders 404-specific title, text and image alt', () => {
|
|
16
|
+
const wrapper = shallowMount(ErrorPage, {
|
|
17
|
+
props: {
|
|
18
|
+
type: '404',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
expect(wrapper.find('.wt-error-page__title').text()).toBe(
|
|
22
|
+
"Looks like you're lost",
|
|
23
|
+
);
|
|
24
|
+
expect(wrapper.find('.wt-error-page__text').text().length).toBeGreaterThan(
|
|
25
|
+
0,
|
|
26
|
+
);
|
|
27
|
+
expect(wrapper.find('.wt-error-page__img').attributes('alt')).toBe(
|
|
28
|
+
'Not found pic',
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('renders 403-specific title, text and image alt', () => {
|
|
33
|
+
const wrapper = shallowMount(ErrorPage, {
|
|
34
|
+
props: {
|
|
35
|
+
type: '403',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
expect(wrapper.find('.wt-error-page__title').text()).toBe('Access denied');
|
|
39
|
+
expect(wrapper.find('.wt-error-page__text').text().length).toBeGreaterThan(
|
|
40
|
+
0,
|
|
41
|
+
);
|
|
42
|
+
expect(wrapper.find('.wt-error-page__img').attributes('alt')).toBe(
|
|
43
|
+
'Forbidden pic',
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('emits back when the action button is clicked', async () => {
|
|
48
|
+
const wrapper = shallowMount(ErrorPage, {
|
|
49
|
+
props: {
|
|
50
|
+
type: '404',
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
await wrapper
|
|
54
|
+
.findComponent({
|
|
55
|
+
name: 'wt-button',
|
|
56
|
+
})
|
|
57
|
+
.vm.$emit('click');
|
|
58
|
+
expect(wrapper.emitted().back).toBeTruthy();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtExpansionCard from '../wt-expansion-card.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtExpansionCard', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtExpansionCard);
|
|
8
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('renders header, body and actions slots', () => {
|
|
12
|
+
const wrapper = mount(WtExpansionCard, {
|
|
13
|
+
slots: {
|
|
14
|
+
header: 'Header content',
|
|
15
|
+
body: 'Body content',
|
|
16
|
+
actions: 'Actions content',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
expect(wrapper.find('.wt-expansion-card-header').text()).toBe(
|
|
20
|
+
'Header content',
|
|
21
|
+
);
|
|
22
|
+
expect(wrapper.find('.wt-expansion-card-body').text()).toBe('Body content');
|
|
23
|
+
expect(wrapper.text()).toContain('Actions content');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('is open by default and toggles closed when the footer is clicked', async () => {
|
|
27
|
+
const wrapper = mount(WtExpansionCard, {
|
|
28
|
+
slots: {
|
|
29
|
+
body: 'Body content',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
expect(
|
|
33
|
+
wrapper.find('.wt-expansion-card-body').element.parentElement.style
|
|
34
|
+
.display,
|
|
35
|
+
).not.toBe('none');
|
|
36
|
+
|
|
37
|
+
await wrapper.find('.wt-expansion-card-actions').trigger('click');
|
|
38
|
+
expect(wrapper.emitted().closed).toBeTruthy();
|
|
39
|
+
|
|
40
|
+
await wrapper.find('.wt-expansion-card-actions').trigger('click');
|
|
41
|
+
expect(wrapper.emitted().opened).toBeTruthy();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('starts collapsed when the collapsed prop is true', () => {
|
|
45
|
+
const wrapper = shallowMount(WtExpansionCard, {
|
|
46
|
+
props: {
|
|
47
|
+
collapsed: true,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
expect(wrapper.find('.wt-expansion-card-arrow').classes()).not.toContain(
|
|
51
|
+
'wt-expansion-card-arrow--opened',
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('applies the size modifier class', () => {
|
|
56
|
+
const wrapper = shallowMount(WtExpansionCard, {
|
|
57
|
+
props: {
|
|
58
|
+
size: 'sm',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
expect(wrapper.classes()).toContain('wt-expansion-card--sm');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import WtExpansionPanel from '../wt-expansion-panel.vue';
|
|
4
4
|
|
|
@@ -7,16 +7,55 @@ describe('WtExpansionPanel', () => {
|
|
|
7
7
|
const wrapper = shallowMount(WtExpansionPanel);
|
|
8
8
|
expect(wrapper.isVisible()).toBe(true);
|
|
9
9
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
wrapper
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
|
|
11
|
+
it('renders title, default and actions slots', () => {
|
|
12
|
+
const wrapper = mount(WtExpansionPanel, {
|
|
13
|
+
slots: {
|
|
14
|
+
title: 'Title content',
|
|
15
|
+
default: 'Body content',
|
|
16
|
+
actions: 'Actions content',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
expect(wrapper.find('.wt-expansion-panel-header').text()).toContain(
|
|
20
|
+
'Title content',
|
|
21
|
+
);
|
|
22
|
+
expect(wrapper.find('.wt-expansion-panel-body').text()).toBe(
|
|
23
|
+
'Body content',
|
|
24
|
+
);
|
|
25
|
+
expect(wrapper.text()).toContain('Actions content');
|
|
15
26
|
});
|
|
16
|
-
|
|
27
|
+
|
|
28
|
+
it('is open by default and emits "closed" on first click', async () => {
|
|
17
29
|
const wrapper = shallowMount(WtExpansionPanel);
|
|
18
|
-
wrapper.
|
|
19
|
-
wrapper.find('.wt-expansion-panel-header').trigger('click');
|
|
30
|
+
await wrapper.find('.wt-expansion-panel-header').trigger('click');
|
|
20
31
|
expect(wrapper.emitted().closed).toBeTruthy();
|
|
32
|
+
expect(wrapper.emitted().opened).toBeFalsy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('emits "opened" on the second click after closing', async () => {
|
|
36
|
+
const wrapper = shallowMount(WtExpansionPanel);
|
|
37
|
+
await wrapper.find('.wt-expansion-panel-header').trigger('click');
|
|
38
|
+
await wrapper.find('.wt-expansion-panel-header').trigger('click');
|
|
39
|
+
expect(wrapper.emitted().opened).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('starts collapsed when the collapsed prop is true', () => {
|
|
43
|
+
const wrapper = shallowMount(WtExpansionPanel, {
|
|
44
|
+
props: {
|
|
45
|
+
collapsed: true,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
expect(wrapper.find('.wt-expansion-panel-arrow').classes()).not.toContain(
|
|
49
|
+
'wt-expansion-panel-arrow--opened',
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('applies the size modifier class', () => {
|
|
54
|
+
const wrapper = shallowMount(WtExpansionPanel, {
|
|
55
|
+
props: {
|
|
56
|
+
size: 'sm',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
expect(wrapper.classes()).toContain('wt-expansion-panel--sm');
|
|
21
60
|
});
|
|
22
61
|
});
|