@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,83 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtImage from '../wt-image.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtImage', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtImage);
|
|
8
|
+
expect(wrapper.exists()).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('applies width/height in px based on the size preset', () => {
|
|
12
|
+
const wrapper = shallowMount(WtImage, {
|
|
13
|
+
props: {
|
|
14
|
+
size: 'sm',
|
|
15
|
+
src: 'pic.png',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
expect(wrapper.attributes('style')).toContain('width: 128px');
|
|
19
|
+
expect(wrapper.attributes('style')).toContain('height: 128px');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('uses explicit width/height props when size is not passed', () => {
|
|
23
|
+
const wrapper = shallowMount(WtImage, {
|
|
24
|
+
props: {
|
|
25
|
+
width: '50%',
|
|
26
|
+
height: 300,
|
|
27
|
+
src: 'pic.png',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
expect(wrapper.attributes('style')).toContain('width: 50%');
|
|
31
|
+
expect(wrapper.attributes('style')).toContain('height: 300px');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('does not render an overlay icon by default', () => {
|
|
35
|
+
const wrapper = shallowMount(WtImage, {
|
|
36
|
+
props: {
|
|
37
|
+
src: 'pic.png',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
expect(wrapper.find('.wt-image__overlay-icon').exists()).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('renders an overlay icon and uses a pointer cursor when overlayIcon is set', () => {
|
|
44
|
+
const wrapper = shallowMount(WtImage, {
|
|
45
|
+
props: {
|
|
46
|
+
overlayIcon: 'edit',
|
|
47
|
+
src: 'pic.png',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
expect(wrapper.find('.wt-image__overlay-icon').exists()).toBe(true);
|
|
51
|
+
expect(wrapper.attributes('style')).toContain('cursor: pointer');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('emits click when clicked', async () => {
|
|
55
|
+
const wrapper = shallowMount(WtImage, {
|
|
56
|
+
props: {
|
|
57
|
+
src: 'pic.png',
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
await wrapper.trigger('click');
|
|
61
|
+
expect(wrapper.emitted().click).toBeTruthy();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('renders custom content via default slot instead of the image', () => {
|
|
65
|
+
const wrapper = shallowMount(WtImage, {
|
|
66
|
+
props: {
|
|
67
|
+
src: 'pic.png',
|
|
68
|
+
alt: 'Alt text',
|
|
69
|
+
},
|
|
70
|
+
slots: {
|
|
71
|
+
default: `<template #default="{ src, alt }"><span class="custom">{{ src }}-{{ alt }}</span></template>`,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
expect(wrapper.find('.custom').text()).toBe('pic.png-Alt text');
|
|
75
|
+
expect(
|
|
76
|
+
wrapper
|
|
77
|
+
.findComponent({
|
|
78
|
+
name: 'Image',
|
|
79
|
+
})
|
|
80
|
+
.exists(),
|
|
81
|
+
).toBe(false);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -28,4 +28,27 @@ describe('WtIndicator', () => {
|
|
|
28
28
|
'wt-indicator__indicator--primary',
|
|
29
29
|
);
|
|
30
30
|
});
|
|
31
|
+
|
|
32
|
+
it('does not render text when text prop is not passed', () => {
|
|
33
|
+
const wrapper = shallowMount(WtIndicator);
|
|
34
|
+
expect(wrapper.find('.wt-indicator__text').exists()).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('renders numeric text values', () => {
|
|
38
|
+
const wrapper = shallowMount(WtIndicator, {
|
|
39
|
+
props: {
|
|
40
|
+
text: 0,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
expect(wrapper.find('.wt-indicator__text').text()).toBe('0');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('applies the size modifier class', () => {
|
|
47
|
+
const wrapper = shallowMount(WtIndicator, {
|
|
48
|
+
props: {
|
|
49
|
+
size: 'sm',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
expect(wrapper.classes()).toContain('wt-indicator--size-sm');
|
|
53
|
+
});
|
|
31
54
|
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtInputNumber from '../wt-input-number.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtInputNumber', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtInputNumber);
|
|
8
|
+
expect(wrapper.classes()).toContain('wt-input-number');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('does not render a label when no label prop or slot is passed', () => {
|
|
12
|
+
const wrapper = shallowMount(WtInputNumber);
|
|
13
|
+
expect(
|
|
14
|
+
wrapper
|
|
15
|
+
.findComponent({
|
|
16
|
+
name: 'wt-label',
|
|
17
|
+
})
|
|
18
|
+
.exists(),
|
|
19
|
+
).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('renders the label text when passed', () => {
|
|
23
|
+
const wrapper = mount(WtInputNumber, {
|
|
24
|
+
props: {
|
|
25
|
+
label: 'Amount',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
expect(wrapper.find('.wt-label').text()).toBe('Amount');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('appends an asterisk to the label when required', () => {
|
|
32
|
+
const wrapper = mount(WtInputNumber, {
|
|
33
|
+
props: {
|
|
34
|
+
label: 'Amount',
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
expect(wrapper.find('.wt-label').text()).toBe('Amount*');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('passes disabled and modelValue down to the underlying input', () => {
|
|
42
|
+
const wrapper = mount(WtInputNumber, {
|
|
43
|
+
props: {
|
|
44
|
+
disabled: true,
|
|
45
|
+
modelValue: 42,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const input = wrapper.findComponent({
|
|
49
|
+
name: 'InputNumber',
|
|
50
|
+
});
|
|
51
|
+
expect(input.props('disabled')).toBe(true);
|
|
52
|
+
expect(input.props('modelValue')).toBe(42);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('emits update:modelValue when the underlying input changes', async () => {
|
|
56
|
+
const wrapper = mount(WtInputNumber);
|
|
57
|
+
const input = wrapper.findComponent({
|
|
58
|
+
name: 'InputNumber',
|
|
59
|
+
});
|
|
60
|
+
await input.vm.$emit('update:model-value', 7);
|
|
61
|
+
expect(wrapper.emitted()['update:modelValue']).toBeTruthy();
|
|
62
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
63
|
+
7,
|
|
64
|
+
]);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('renders prefix and suffix slots', () => {
|
|
68
|
+
const wrapper = mount(WtInputNumber, {
|
|
69
|
+
slots: {
|
|
70
|
+
prefix: '$',
|
|
71
|
+
suffix: 'USD',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
expect(wrapper.text()).toContain('$');
|
|
75
|
+
expect(wrapper.text()).toContain('USD');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtInputText from '../wt-input-text.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtInputText', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtInputText);
|
|
8
|
+
expect(wrapper.classes()).toContain('wt-input-text');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('does not render a label when no label prop or slot is passed', () => {
|
|
12
|
+
const wrapper = shallowMount(WtInputText);
|
|
13
|
+
expect(
|
|
14
|
+
wrapper
|
|
15
|
+
.findComponent({
|
|
16
|
+
name: 'wt-label',
|
|
17
|
+
})
|
|
18
|
+
.exists(),
|
|
19
|
+
).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('renders the label text when passed', () => {
|
|
23
|
+
const wrapper = mount(WtInputText, {
|
|
24
|
+
props: {
|
|
25
|
+
label: 'Name',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
expect(wrapper.find('.wt-label').text()).toBe('Name');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('trims the value by default on input', () => {
|
|
32
|
+
const wrapper = mount(WtInputText);
|
|
33
|
+
const input = wrapper.findComponent({
|
|
34
|
+
name: 'InputText',
|
|
35
|
+
});
|
|
36
|
+
input.vm.$emit('update:model-value', ' hello ');
|
|
37
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
38
|
+
'hello',
|
|
39
|
+
]);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('does not trim the value when preventTrim is true', () => {
|
|
43
|
+
const wrapper = mount(WtInputText, {
|
|
44
|
+
props: {
|
|
45
|
+
preventTrim: true,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const input = wrapper.findComponent({
|
|
49
|
+
name: 'InputText',
|
|
50
|
+
});
|
|
51
|
+
input.vm.$emit('update:model-value', ' hello ');
|
|
52
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
|
|
53
|
+
' hello ',
|
|
54
|
+
]);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('toggles the eye icon and masks the input when hideInputValue is true', async () => {
|
|
58
|
+
const wrapper = mount(WtInputText, {
|
|
59
|
+
props: {
|
|
60
|
+
hideInputValue: true,
|
|
61
|
+
modelValue: 'secret',
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
const input = wrapper.find('.wt-input-text__input');
|
|
65
|
+
expect(input.classes()).toContain('wt-input-text__input--masked');
|
|
66
|
+
|
|
67
|
+
await wrapper
|
|
68
|
+
.findComponent({
|
|
69
|
+
name: 'wt-icon-btn',
|
|
70
|
+
})
|
|
71
|
+
.trigger('click');
|
|
72
|
+
expect(wrapper.find('.wt-input-text__input').classes()).not.toContain(
|
|
73
|
+
'wt-input-text__input--masked',
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('emits focus when the underlying input is focused', async () => {
|
|
78
|
+
const wrapper = mount(WtInputText);
|
|
79
|
+
const input = wrapper.findComponent({
|
|
80
|
+
name: 'InputText',
|
|
81
|
+
});
|
|
82
|
+
await input.vm.$emit('focus', new Event('focus'));
|
|
83
|
+
expect(wrapper.emitted().focus).toBeTruthy();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -3,13 +3,34 @@ import { shallowMount } from '@vue/test-utils';
|
|
|
3
3
|
import WtIntersectionObserver from '../wt-intersection-observer.vue';
|
|
4
4
|
|
|
5
5
|
describe('WtIntersectionObserver', () => {
|
|
6
|
-
const next = () => true;
|
|
7
6
|
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtIntersectionObserver);
|
|
8
|
+
expect(wrapper.exists()).toBe(true);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('does not render a loader by default', () => {
|
|
12
|
+
const wrapper = shallowMount(WtIntersectionObserver);
|
|
13
|
+
expect(
|
|
14
|
+
wrapper
|
|
15
|
+
.findComponent({
|
|
16
|
+
name: 'wt-loader',
|
|
17
|
+
})
|
|
18
|
+
.exists(),
|
|
19
|
+
).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('renders a loader when loading is true', () => {
|
|
8
23
|
const wrapper = shallowMount(WtIntersectionObserver, {
|
|
9
24
|
props: {
|
|
10
|
-
|
|
25
|
+
loading: true,
|
|
11
26
|
},
|
|
12
27
|
});
|
|
13
|
-
expect(
|
|
28
|
+
expect(
|
|
29
|
+
wrapper
|
|
30
|
+
.findComponent({
|
|
31
|
+
name: 'wt-loader',
|
|
32
|
+
})
|
|
33
|
+
.exists(),
|
|
34
|
+
).toBe(true);
|
|
14
35
|
});
|
|
15
36
|
});
|
|
@@ -2,9 +2,101 @@ import { shallowMount } from '@vue/test-utils';
|
|
|
2
2
|
|
|
3
3
|
import WtItemLink from '../wt-item-link.vue';
|
|
4
4
|
|
|
5
|
+
const stubs = {
|
|
6
|
+
RouterLink: {
|
|
7
|
+
props: [
|
|
8
|
+
'to',
|
|
9
|
+
'target',
|
|
10
|
+
],
|
|
11
|
+
template:
|
|
12
|
+
'<a :href="typeof to === \'string\' ? to : JSON.stringify(to)" :target="target"><slot /></a>',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
|
|
5
16
|
describe('WtItemLink', () => {
|
|
6
17
|
it('renders a component', () => {
|
|
7
|
-
const wrapper = shallowMount(WtItemLink
|
|
18
|
+
const wrapper = shallowMount(WtItemLink, {
|
|
19
|
+
global: {
|
|
20
|
+
stubs,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
8
23
|
expect(wrapper.exists()).toBe(true);
|
|
9
24
|
});
|
|
25
|
+
|
|
26
|
+
it('renders default slot content', () => {
|
|
27
|
+
const wrapper = shallowMount(WtItemLink, {
|
|
28
|
+
global: {
|
|
29
|
+
stubs,
|
|
30
|
+
},
|
|
31
|
+
slots: {
|
|
32
|
+
default: 'Link text',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
expect(wrapper.text()).toBe('Link text');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('uses the link prop as the route target when provided', () => {
|
|
39
|
+
const wrapper = shallowMount(WtItemLink, {
|
|
40
|
+
global: {
|
|
41
|
+
stubs,
|
|
42
|
+
},
|
|
43
|
+
props: {
|
|
44
|
+
link: '/directory/users/3',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
expect(wrapper.attributes('href')).toBe('/directory/users/3');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('builds a route from the deprecated routeName/id props when link is not provided', () => {
|
|
51
|
+
const wrapper = shallowMount(WtItemLink, {
|
|
52
|
+
global: {
|
|
53
|
+
stubs,
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
routeName: 'users',
|
|
57
|
+
id: 3,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
expect(wrapper.attributes('href')).toBe(
|
|
61
|
+
JSON.stringify({
|
|
62
|
+
name: 'users-edit',
|
|
63
|
+
params: {
|
|
64
|
+
id: 3,
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('applies the disabled class', () => {
|
|
71
|
+
const wrapper = shallowMount(WtItemLink, {
|
|
72
|
+
global: {
|
|
73
|
+
stubs,
|
|
74
|
+
},
|
|
75
|
+
props: {
|
|
76
|
+
disabled: true,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
expect(wrapper.classes()).toContain('wt-item-link--disabled');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('applies the invisible class', () => {
|
|
83
|
+
const wrapper = shallowMount(WtItemLink, {
|
|
84
|
+
global: {
|
|
85
|
+
stubs,
|
|
86
|
+
},
|
|
87
|
+
props: {
|
|
88
|
+
invisible: true,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
expect(wrapper.classes()).toContain('wt-item-link--invisible');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('defaults target to _self and forwards a custom target', () => {
|
|
95
|
+
const wrapper = shallowMount(WtItemLink, {
|
|
96
|
+
global: {
|
|
97
|
+
stubs,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
expect(wrapper.attributes('target')).toBe('_self');
|
|
101
|
+
});
|
|
10
102
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import WtLabel from '../wt-label.vue';
|
|
4
4
|
|
|
@@ -7,4 +7,52 @@ describe('WtLabel', () => {
|
|
|
7
7
|
const wrapper = shallowMount(WtLabel);
|
|
8
8
|
expect(wrapper.classes('wt-label')).toBe(true);
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
it('renders default slot content', () => {
|
|
12
|
+
const wrapper = shallowMount(WtLabel, {
|
|
13
|
+
slots: {
|
|
14
|
+
default: 'Field label',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
expect(wrapper.text()).toContain('Field label');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('applies disabled/invalid/required modifier classes', () => {
|
|
21
|
+
const wrapper = shallowMount(WtLabel, {
|
|
22
|
+
props: {
|
|
23
|
+
disabled: true,
|
|
24
|
+
invalid: true,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
expect(wrapper.classes()).toContain('wt-label--disabled');
|
|
29
|
+
expect(wrapper.classes()).toContain('wt-label--invalid');
|
|
30
|
+
expect(wrapper.classes()).toContain('wt-label--required');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('does not render a hint by default', () => {
|
|
34
|
+
const wrapper = shallowMount(WtLabel);
|
|
35
|
+
expect(
|
|
36
|
+
wrapper
|
|
37
|
+
.findComponent({
|
|
38
|
+
name: 'wt-hint',
|
|
39
|
+
})
|
|
40
|
+
.exists(),
|
|
41
|
+
).toBe(false);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('renders a hint when the hint prop is passed', async () => {
|
|
45
|
+
const wrapper = mount(WtLabel, {
|
|
46
|
+
props: {
|
|
47
|
+
hint: 'Extra info',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const hint = wrapper.findComponent({
|
|
51
|
+
name: 'wt-hint',
|
|
52
|
+
});
|
|
53
|
+
expect(hint.exists()).toBe(true);
|
|
54
|
+
|
|
55
|
+
await hint.find('.wt-tooltip__activator').trigger('mouseenter');
|
|
56
|
+
expect(wrapper.text()).toContain('Extra info');
|
|
57
|
+
});
|
|
10
58
|
});
|
|
@@ -7,4 +7,53 @@ describe('WtLoadBar', () => {
|
|
|
7
7
|
const wrapper = shallowMount(WtLoadBar);
|
|
8
8
|
expect(wrapper.exists()).toBe(true);
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
it('renders 0% width by default', () => {
|
|
12
|
+
const wrapper = shallowMount(WtLoadBar);
|
|
13
|
+
expect(wrapper.find('.wt-load-bar__progress').attributes('style')).toBe(
|
|
14
|
+
'width: 0%;',
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('computes progress width as a percentage of value/max', () => {
|
|
19
|
+
const wrapper = shallowMount(WtLoadBar, {
|
|
20
|
+
props: {
|
|
21
|
+
value: 25,
|
|
22
|
+
max: 50,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
expect(wrapper.find('.wt-load-bar__progress').attributes('style')).toBe(
|
|
26
|
+
'width: 50%;',
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// NOTE: progressWidth references `this.isOverflow`, which is never defined
|
|
31
|
+
// (no such data/computed property exists), so it's always undefined/falsy.
|
|
32
|
+
// Progress width is therefore never clamped to 100 and can overflow past
|
|
33
|
+
// it when value > max — documenting the current (likely unintended) behavior.
|
|
34
|
+
it('does not clamp progress width when value exceeds max', () => {
|
|
35
|
+
const wrapper = shallowMount(WtLoadBar, {
|
|
36
|
+
props: {
|
|
37
|
+
value: 150,
|
|
38
|
+
max: 100,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
expect(wrapper.find('.wt-load-bar__progress').attributes('style')).toBe(
|
|
42
|
+
'width: 150%;',
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('applies the default primary color class', () => {
|
|
47
|
+
const wrapper = shallowMount(WtLoadBar);
|
|
48
|
+
expect(wrapper.classes()).toContain('wt-load-bar--color-primary');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('applies a custom color class', () => {
|
|
52
|
+
const wrapper = shallowMount(WtLoadBar, {
|
|
53
|
+
props: {
|
|
54
|
+
color: 'error',
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
expect(wrapper.classes()).toContain('wt-load-bar--color-error');
|
|
58
|
+
});
|
|
10
59
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import WtLoader from '../wt-loader.vue';
|
|
4
4
|
|
|
@@ -7,4 +7,29 @@ describe('WtLoader', () => {
|
|
|
7
7
|
const wrapper = shallowMount(WtLoader);
|
|
8
8
|
expect(wrapper.classes('wt-loader')).toBe(true);
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
it('renders the brand loader by default (size md)', () => {
|
|
12
|
+
const wrapper = mount(WtLoader);
|
|
13
|
+
expect(wrapper.classes()).toContain('wt-brand-loader');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('renders the spinner loader for non-md sizes', () => {
|
|
17
|
+
const wrapper = mount(WtLoader, {
|
|
18
|
+
props: {
|
|
19
|
+
size: 'sm',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
expect(wrapper.classes()).toContain('wt-spinner-loader');
|
|
23
|
+
expect(wrapper.classes()).toContain('wt-spinner-loader--sm');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('applies the color to the spinner loader', () => {
|
|
27
|
+
const wrapper = mount(WtLoader, {
|
|
28
|
+
props: {
|
|
29
|
+
size: 'xs',
|
|
30
|
+
color: 'icon',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
expect(wrapper.classes()).toContain('wt-spinner-loader--icon');
|
|
34
|
+
});
|
|
10
35
|
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtLogo from '../wt-logo.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtLogo', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = shallowMount(WtLogo);
|
|
8
|
+
expect(wrapper.exists()).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('renders an anchor with logoHref by default', () => {
|
|
12
|
+
const wrapper = shallowMount(WtLogo, {
|
|
13
|
+
props: {
|
|
14
|
+
logoHref: 'https://example.com',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
expect(wrapper.element.tagName).toBe('A');
|
|
18
|
+
expect(wrapper.attributes('href')).toBe('https://example.com');
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('renders a router-link when logoRoute is provided', () => {
|
|
22
|
+
const wrapper = shallowMount(WtLogo, {
|
|
23
|
+
props: {
|
|
24
|
+
logoRoute: '/home',
|
|
25
|
+
},
|
|
26
|
+
global: {
|
|
27
|
+
stubs: {
|
|
28
|
+
RouterLink: {
|
|
29
|
+
props: [
|
|
30
|
+
'to',
|
|
31
|
+
],
|
|
32
|
+
template: '<a :href="to"><slot /></a>',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
expect(wrapper.attributes('href')).toBe('/home');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('renders a plain span with no link attrs when disabled', () => {
|
|
41
|
+
const wrapper = shallowMount(WtLogo, {
|
|
42
|
+
props: {
|
|
43
|
+
disabled: true,
|
|
44
|
+
logoHref: 'https://example.com',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
expect(wrapper.element.tagName).toBe('SPAN');
|
|
48
|
+
expect(wrapper.attributes('href')).toBeUndefined();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('renders the logo image', () => {
|
|
52
|
+
const wrapper = shallowMount(WtLogo);
|
|
53
|
+
expect(wrapper.find('img.wt-logo').attributes('alt')).toBe('Webitel');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtMenubar from '../wt-menubar.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtMenubar', () => {
|
|
6
|
+
it('renders a component', () => {
|
|
7
|
+
const wrapper = mount(WtMenubar);
|
|
8
|
+
expect(wrapper.classes()).toContain('wt-menubar');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('forwards named slots through to PMenubar, excluding default', () => {
|
|
12
|
+
const wrapper = mount(WtMenubar, {
|
|
13
|
+
slots: {
|
|
14
|
+
start: 'Start content',
|
|
15
|
+
end: 'End content',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
expect(wrapper.text()).toContain('Start content');
|
|
19
|
+
expect(wrapper.text()).toContain('End content');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('does not render default slot content', () => {
|
|
23
|
+
const wrapper = mount(WtMenubar, {
|
|
24
|
+
slots: {
|
|
25
|
+
default: 'Default content',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
expect(wrapper.text()).not.toContain('Default content');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import { MessageColor, MessageVariant } from '../../../enums';
|
|
4
|
+
import WtMessage from '../wt-message.vue';
|
|
5
|
+
|
|
6
|
+
describe('WtMessage', () => {
|
|
7
|
+
it('renders a component', () => {
|
|
8
|
+
const wrapper = shallowMount(WtMessage);
|
|
9
|
+
expect(
|
|
10
|
+
wrapper
|
|
11
|
+
.findComponent({
|
|
12
|
+
name: 'Message',
|
|
13
|
+
})
|
|
14
|
+
.exists(),
|
|
15
|
+
).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('applies default color, variant and size', () => {
|
|
19
|
+
const wrapper = shallowMount(WtMessage);
|
|
20
|
+
expect(wrapper.attributes('severity')).toBe(MessageColor.SECONDARY);
|
|
21
|
+
expect(wrapper.attributes('variant')).toBe(MessageVariant.FILLED);
|
|
22
|
+
expect(wrapper.attributes('size')).toBe('normal');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('maps custom color, variant and size props', () => {
|
|
26
|
+
const wrapper = shallowMount(WtMessage, {
|
|
27
|
+
props: {
|
|
28
|
+
color: MessageColor.ERROR,
|
|
29
|
+
variant: MessageVariant.SIMPLE,
|
|
30
|
+
size: 'sm',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
expect(wrapper.attributes('severity')).toBe(MessageColor.ERROR);
|
|
34
|
+
expect(wrapper.attributes('variant')).toBe(MessageVariant.SIMPLE);
|
|
35
|
+
expect(wrapper.attributes('size')).toBe('small');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('renders default slot content', () => {
|
|
39
|
+
const wrapper = mount(WtMessage, {
|
|
40
|
+
slots: {
|
|
41
|
+
default: 'Something happened',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
expect(wrapper.text()).toContain('Something happened');
|
|
45
|
+
});
|
|
46
|
+
});
|