@webitel/ui-sdk 26.8.75 → 26.8.77
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-B8-WDK4d.js} +66 -79
- package/dist/{components-C-ri6OSQ.js → components-fKLMXHe_.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 +610 -612
- 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-BwPz__rU.js} +2 -2
- package/dist/{wt-chat-emoji-CLhgb02d.js → wt-chat-emoji-DcVCe4jW.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-D-v25BUi.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-action-DYBTs3Mf.js → wt-icon-action-DJzm0kEk.js} +1 -1
- package/dist/{wt-icon-btn-BfhuUt8-.js → wt-icon-btn-BzraLc-w.js} +1 -1
- package/dist/{wt-icon-WyFAGc4t.js → wt-icon-iRDqWkjp.js} +19 -19
- package/dist/{wt-notifications-bar-CvKwuTEg.js → wt-notifications-bar-ZIMKBDqL.js} +2 -2
- package/dist/{wt-player-B2etfN5v.js → wt-player-CFrKSilF.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-BpgjqxvU.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-BcgNZFCD.js} +2 -2
- package/dist/{wt-tree-table-C5sxm-Eb.js → wt-tree-table-xXbBeLUc.js} +1 -1
- package/dist/{wt-type-extension-value-input-gQGgxMcJ.js → wt-type-extension-value-input-D86gV8RI.js} +3 -3
- package/dist/{wt-vidstack-player-B37Mdf0u.js → wt-vidstack-player-BzyyVEji.js} +4 -4
- package/package.json +1 -1
- package/src/assets/icons/sprite/call--filled.svg +1 -1
- package/src/assets/icons/sprite/call-add-to--filled.svg +2 -2
- package/src/assets/icons/sprite/call-add-to.svg +2 -3
- package/src/assets/icons/sprite/call-disconnect--filled.svg +2 -2
- package/src/assets/icons/sprite/call-disconnect.svg +2 -2
- package/src/assets/icons/sprite/call-end--filled.svg +2 -1
- package/src/assets/icons/sprite/call-end.svg +2 -2
- package/src/assets/icons/sprite/call-inbound--filled.svg +2 -3
- package/src/assets/icons/sprite/call-inbound.svg +2 -2
- package/src/assets/icons/sprite/call-missed--filled.svg +2 -2
- package/src/assets/icons/sprite/call-missed.svg +2 -2
- package/src/assets/icons/sprite/call-outbound--filled.svg +2 -2
- package/src/assets/icons/sprite/call-outbound.svg +2 -2
- package/src/assets/icons/sprite/call-ringing--filled.svg +3 -4
- package/src/assets/icons/sprite/call-ringing.svg +3 -2
- package/src/assets/icons/sprite/call-transfer--filled.svg +2 -2
- package/src/assets/icons/sprite/call-transfer.svg +2 -2
- package/src/assets/icons/sprite/call.svg +1 -2
- 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
|
@@ -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
|
});
|
|
@@ -1,22 +1,93 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { flushPromises, mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
|
+
import WtTableActions from '../../wt-table-actions/wt-table-actions.vue';
|
|
3
4
|
import FiltersPanelWrapper from '../wt-filters-panel-wrapper.vue';
|
|
4
5
|
|
|
6
|
+
const mountWithTableActions = (options) =>
|
|
7
|
+
mount(FiltersPanelWrapper, {
|
|
8
|
+
...options,
|
|
9
|
+
global: {
|
|
10
|
+
...options?.global,
|
|
11
|
+
stubs: {
|
|
12
|
+
WtTableActions: false,
|
|
13
|
+
...options?.global?.stubs,
|
|
14
|
+
},
|
|
15
|
+
components: {
|
|
16
|
+
WtTableActions,
|
|
17
|
+
...options?.global?.components,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
5
22
|
describe('Filters Panel Wrapper', () => {
|
|
6
23
|
it('renders a component', () => {
|
|
7
24
|
const wrapper = shallowMount(FiltersPanelWrapper);
|
|
8
25
|
expect(wrapper.exists()).toBe(true);
|
|
9
26
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
wrapper
|
|
27
|
+
|
|
28
|
+
it('renders default slot content in the filters wrap', () => {
|
|
29
|
+
const wrapper = shallowMount(FiltersPanelWrapper, {
|
|
30
|
+
slots: {
|
|
31
|
+
default: 'Filter fields',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
expect(wrapper.find('.filters-wrap').text()).toBe('Filter fields');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('emits "reset" event when wt-table-actions emits input with "filterReset"', async () => {
|
|
38
|
+
const wrapper = mountWithTableActions();
|
|
39
|
+
await flushPromises();
|
|
40
|
+
await wrapper
|
|
41
|
+
.findComponent({
|
|
42
|
+
name: 'wt-table-actions',
|
|
43
|
+
})
|
|
44
|
+
.vm.$emit('input', 'filterReset');
|
|
13
45
|
expect(wrapper.emitted().reset).toBeTruthy();
|
|
14
46
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
47
|
+
|
|
48
|
+
// NOTE: the "opened" class is bound to the `isOpened` prop in the template, but
|
|
49
|
+
// toggleFiltersExpansion (triggered by the "settings" table action) mutates the
|
|
50
|
+
// separate `localIsOpened` data property, which nothing reads. So this handler
|
|
51
|
+
// currently has no visible effect on the rendered class — asserting that as the
|
|
52
|
+
// actual current behavior rather than the presumably-intended toggle.
|
|
53
|
+
it('does not change "filters-panel-wrapper--opened" class when wt-table-actions emits input with "settings"', async () => {
|
|
54
|
+
const wrapper = mountWithTableActions();
|
|
55
|
+
await flushPromises();
|
|
56
|
+
expect(wrapper.classes()).not.toContain('filters-panel-wrapper--opened');
|
|
57
|
+
|
|
58
|
+
await wrapper
|
|
59
|
+
.findComponent({
|
|
60
|
+
name: 'wt-table-actions',
|
|
61
|
+
})
|
|
62
|
+
.vm.$emit('input', 'settings');
|
|
63
|
+
expect(wrapper.classes()).not.toContain('filters-panel-wrapper--opened');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('starts opened when isOpened prop is true', () => {
|
|
67
|
+
const wrapper = shallowMount(FiltersPanelWrapper, {
|
|
68
|
+
props: {
|
|
69
|
+
isOpened: true,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
expect(wrapper.classes()).toContain('filters-panel-wrapper--opened');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('passes tableActionIcons down to wt-table-actions', async () => {
|
|
76
|
+
const icons = [
|
|
77
|
+
'filter-reset',
|
|
78
|
+
];
|
|
79
|
+
const wrapper = mountWithTableActions({
|
|
80
|
+
props: {
|
|
81
|
+
tableActionIcons: icons,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
await flushPromises();
|
|
85
|
+
expect(
|
|
86
|
+
wrapper
|
|
87
|
+
.findComponent({
|
|
88
|
+
name: 'wt-table-actions',
|
|
89
|
+
})
|
|
90
|
+
.props('icons'),
|
|
91
|
+
).toEqual(icons);
|
|
21
92
|
});
|
|
22
93
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { flushPromises, mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import WtHint from '../wt-hint.vue';
|
|
4
4
|
|
|
@@ -7,4 +7,47 @@ describe('WtHint', () => {
|
|
|
7
7
|
const wrapper = shallowMount(WtHint);
|
|
8
8
|
expect(wrapper.isVisible()).toBe(true);
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
it('renders the default info icon color', async () => {
|
|
12
|
+
const wrapper = mount(WtHint);
|
|
13
|
+
await flushPromises();
|
|
14
|
+
expect(
|
|
15
|
+
wrapper
|
|
16
|
+
.findComponent({
|
|
17
|
+
name: 'wt-icon-btn',
|
|
18
|
+
})
|
|
19
|
+
.attributes('color'),
|
|
20
|
+
).toBe('info');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('applies a custom icon color', async () => {
|
|
24
|
+
const wrapper = mount(WtHint, {
|
|
25
|
+
props: {
|
|
26
|
+
iconColor: 'error',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
await flushPromises();
|
|
30
|
+
expect(
|
|
31
|
+
wrapper
|
|
32
|
+
.findComponent({
|
|
33
|
+
name: 'wt-icon-btn',
|
|
34
|
+
})
|
|
35
|
+
.attributes('color'),
|
|
36
|
+
).toBe('error');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders default slot content once the tooltip is shown', async () => {
|
|
40
|
+
const content = 'Hint text';
|
|
41
|
+
const wrapper = mount(WtHint, {
|
|
42
|
+
slots: {
|
|
43
|
+
default: content,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
await flushPromises();
|
|
47
|
+
|
|
48
|
+
await wrapper.find('.wt-tooltip__activator').trigger('mouseenter');
|
|
49
|
+
await flushPromises();
|
|
50
|
+
|
|
51
|
+
expect(wrapper.text()).toContain(content);
|
|
52
|
+
});
|
|
10
53
|
});
|
|
@@ -39,4 +39,33 @@ describe('WtIcon', () => {
|
|
|
39
39
|
]),
|
|
40
40
|
);
|
|
41
41
|
});
|
|
42
|
+
|
|
43
|
+
it('applies the disabled class when disabled', () => {
|
|
44
|
+
const wrapper = shallowMount(WtIcon, {
|
|
45
|
+
props: {
|
|
46
|
+
icon: 'bucket',
|
|
47
|
+
disabled: true,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
expect(wrapper.classes()).toContain('wt-icon--disabled');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('falls back to the raw icon name when not found in the repository', () => {
|
|
54
|
+
const wrapper = shallowMount(WtIcon, {
|
|
55
|
+
props: {
|
|
56
|
+
icon: 'totally-unknown-icon',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
expect(wrapper.vm.iconSvg).toBe('totally-unknown-icon');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('emits click when clicked', async () => {
|
|
63
|
+
const wrapper = shallowMount(WtIcon, {
|
|
64
|
+
props: {
|
|
65
|
+
icon: 'bucket',
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
await wrapper.trigger('click');
|
|
69
|
+
expect(wrapper.emitted().click).toBeTruthy();
|
|
70
|
+
});
|
|
42
71
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
|
+
import { IconAction } from '../../../enums';
|
|
4
|
+
import { SortSymbols } from '../../../scripts/sortQueryAdapters.js';
|
|
3
5
|
import WtIconAction from '../wt-icon-action.vue';
|
|
4
6
|
|
|
5
7
|
describe('WtIconAction', () => {
|
|
@@ -11,4 +13,81 @@ describe('WtIconAction', () => {
|
|
|
11
13
|
});
|
|
12
14
|
expect(wrapper.isVisible()).toBe(true);
|
|
13
15
|
});
|
|
16
|
+
|
|
17
|
+
it('maps a known action to its icon', () => {
|
|
18
|
+
const wrapper = shallowMount(WtIconAction, {
|
|
19
|
+
props: {
|
|
20
|
+
action: IconAction.DELETE,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
expect(
|
|
24
|
+
wrapper
|
|
25
|
+
.findComponent({
|
|
26
|
+
name: 'wt-icon-btn',
|
|
27
|
+
})
|
|
28
|
+
.attributes('icon'),
|
|
29
|
+
).toBe('bucket');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('uses sort-asc icon by default for the sort action', () => {
|
|
33
|
+
const wrapper = shallowMount(WtIconAction, {
|
|
34
|
+
props: {
|
|
35
|
+
action: IconAction.SORT,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
expect(
|
|
39
|
+
wrapper
|
|
40
|
+
.findComponent({
|
|
41
|
+
name: 'wt-icon-btn',
|
|
42
|
+
})
|
|
43
|
+
.attributes('icon'),
|
|
44
|
+
).toBe('sort-asc');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('uses sort-desc icon for the sort action when sort:order is desc', () => {
|
|
48
|
+
const wrapper = shallowMount(WtIconAction, {
|
|
49
|
+
props: {
|
|
50
|
+
action: IconAction.SORT,
|
|
51
|
+
'sort:order': SortSymbols.DESC,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
expect(
|
|
55
|
+
wrapper
|
|
56
|
+
.findComponent({
|
|
57
|
+
name: 'wt-icon-btn',
|
|
58
|
+
})
|
|
59
|
+
.attributes('icon'),
|
|
60
|
+
).toBe('sort-desc');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('passes disabled and size down to wt-icon-btn', () => {
|
|
64
|
+
const wrapper = shallowMount(WtIconAction, {
|
|
65
|
+
props: {
|
|
66
|
+
action: IconAction.EDIT,
|
|
67
|
+
disabled: true,
|
|
68
|
+
size: 'lg',
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
const iconBtn = wrapper.findComponent({
|
|
72
|
+
name: 'wt-icon-btn',
|
|
73
|
+
});
|
|
74
|
+
expect(iconBtn.props('disabled')).toBe(true);
|
|
75
|
+
expect(iconBtn.attributes('size')).toBe('lg');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('emits click and mousedown from the underlying icon button', async () => {
|
|
79
|
+
const wrapper = shallowMount(WtIconAction, {
|
|
80
|
+
props: {
|
|
81
|
+
action: IconAction.EDIT,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const iconBtn = wrapper.findComponent({
|
|
85
|
+
name: 'wt-icon-btn',
|
|
86
|
+
});
|
|
87
|
+
await iconBtn.vm.$emit('click');
|
|
88
|
+
await iconBtn.vm.$emit('mousedown');
|
|
89
|
+
|
|
90
|
+
expect(wrapper.emitted().click).toBeTruthy();
|
|
91
|
+
expect(wrapper.emitted().mousedown).toBeTruthy();
|
|
92
|
+
});
|
|
14
93
|
});
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { computed } from 'vue';
|
|
14
14
|
import { useI18n } from 'vue-i18n';
|
|
15
15
|
|
|
16
|
-
import IconAction from '../../enums
|
|
16
|
+
import { IconAction } from '../../enums';
|
|
17
17
|
import { SortSymbols } from '../../scripts/sortQueryAdapters.js';
|
|
18
18
|
import { WtIconActionIconMappings } from './iconMappings.js';
|
|
19
19
|
|
|
@@ -15,4 +15,50 @@ describe('WtIconBtn', () => {
|
|
|
15
15
|
});
|
|
16
16
|
expect(wrapper.classes('wt-icon-btn')).toBe(true);
|
|
17
17
|
});
|
|
18
|
+
|
|
19
|
+
it('passes icon and other attrs through to wt-icon', () => {
|
|
20
|
+
const wrapper = shallowMount(WtIconBtn, {
|
|
21
|
+
stubs: {
|
|
22
|
+
WtIcon,
|
|
23
|
+
},
|
|
24
|
+
attrs: {
|
|
25
|
+
icon: 'bucket',
|
|
26
|
+
color: 'error',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const icon = wrapper.findComponent(WtIcon);
|
|
30
|
+
expect(icon.props('icon')).toBe('bucket');
|
|
31
|
+
expect(icon.props('color')).toBe('error');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('applies the disabled class and forwards disabled to wt-icon', () => {
|
|
35
|
+
const wrapper = shallowMount(WtIconBtn, {
|
|
36
|
+
stubs: {
|
|
37
|
+
WtIcon,
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
disabled: true,
|
|
41
|
+
},
|
|
42
|
+
attrs: {
|
|
43
|
+
icon: 'bucket',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
expect(wrapper.classes()).toContain('wt-icon-btn--disabled');
|
|
47
|
+
expect(wrapper.findComponent(WtIcon).props('disabled')).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('emits click and mousedown', async () => {
|
|
51
|
+
const wrapper = shallowMount(WtIconBtn, {
|
|
52
|
+
stubs: {
|
|
53
|
+
WtIcon,
|
|
54
|
+
},
|
|
55
|
+
attrs: {
|
|
56
|
+
icon: 'bucket',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
await wrapper.trigger('click');
|
|
60
|
+
await wrapper.trigger('mousedown');
|
|
61
|
+
expect(wrapper.emitted().click).toBeTruthy();
|
|
62
|
+
expect(wrapper.emitted().mousedown).toBeTruthy();
|
|
63
|
+
});
|
|
18
64
|
});
|