@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.
Files changed (174) hide show
  1. package/dist/{clients-BmeOR90W.js → clients-B8-WDK4d.js} +66 -79
  2. package/dist/{components-C-ri6OSQ.js → components-fKLMXHe_.js} +11 -11
  3. package/dist/{enums-BvonmHq2.js → enums-B_9ZBu01.js} +2 -2
  4. package/dist/ui-sdk.css +1 -1
  5. package/dist/ui-sdk.js +3 -3
  6. package/dist/ui-sdk.umd.cjs +610 -612
  7. package/dist/{useValidation-0JwQGpLM.js → useValidation-CEed9cxY.js} +1 -1
  8. package/dist/{utils-CzBdLnFt.js → utils-BZHq8qMH.js} +1 -1
  9. package/dist/wt-action-bar-D74sgDCk.js +94 -0
  10. package/dist/{wt-button-D-nFhi1f.js → wt-button-BwPz__rU.js} +2 -2
  11. package/dist/{wt-chat-emoji-CLhgb02d.js → wt-chat-emoji-DcVCe4jW.js} +4 -4
  12. package/dist/{wt-datepicker-DCa23hYx.js → wt-datepicker-BgjjbOMX.js} +2 -2
  13. package/dist/{wt-display-chip-items-B7QLz9QM.js → wt-display-chip-items-D-v25BUi.js} +2 -2
  14. package/dist/{wt-dual-panel-D-LChluY.js → wt-dual-panel-Cs_Yzfxt.js} +1 -1
  15. package/dist/{wt-expansion-card-CToBA1fy.js → wt-expansion-card-BT586Mul.js} +1 -1
  16. package/dist/{wt-expansion-panel-af2t3VrM.js → wt-expansion-panel-kZmHSvPU.js} +1 -1
  17. package/dist/{wt-icon-action-DYBTs3Mf.js → wt-icon-action-DJzm0kEk.js} +1 -1
  18. package/dist/{wt-icon-btn-BfhuUt8-.js → wt-icon-btn-BzraLc-w.js} +1 -1
  19. package/dist/{wt-icon-WyFAGc4t.js → wt-icon-iRDqWkjp.js} +19 -19
  20. package/dist/{wt-notifications-bar-CvKwuTEg.js → wt-notifications-bar-ZIMKBDqL.js} +2 -2
  21. package/dist/{wt-player-B2etfN5v.js → wt-player-CFrKSilF.js} +3 -3
  22. package/dist/{wt-screen-recordings-action-CepB2pqh.js → wt-screen-recordings-action-CVHZAWjl.js} +1 -1
  23. package/dist/{wt-search-bar-B4YkhgIB.js → wt-search-bar-DosqJLXT.js} +1 -1
  24. package/dist/{wt-send-message-popup-BhZ7K_Vs.js → wt-send-message-popup-BpgjqxvU.js} +2 -2
  25. package/dist/{wt-status-select-ELI7j73g.js → wt-status-select-Dnv9tj7o.js} +1 -1
  26. package/dist/{wt-timepicker-C3v9Cp2e.js → wt-timepicker-B4MOaSEZ.js} +2 -2
  27. package/dist/{wt-toast-DxQBRGm2.js → wt-toast-BcgNZFCD.js} +2 -2
  28. package/dist/{wt-tree-table-C5sxm-Eb.js → wt-tree-table-xXbBeLUc.js} +1 -1
  29. package/dist/{wt-type-extension-value-input-gQGgxMcJ.js → wt-type-extension-value-input-D86gV8RI.js} +3 -3
  30. package/dist/{wt-vidstack-player-B37Mdf0u.js → wt-vidstack-player-BzyyVEji.js} +4 -4
  31. package/package.json +1 -1
  32. package/src/assets/icons/sprite/call--filled.svg +1 -1
  33. package/src/assets/icons/sprite/call-add-to--filled.svg +2 -2
  34. package/src/assets/icons/sprite/call-add-to.svg +2 -3
  35. package/src/assets/icons/sprite/call-disconnect--filled.svg +2 -2
  36. package/src/assets/icons/sprite/call-disconnect.svg +2 -2
  37. package/src/assets/icons/sprite/call-end--filled.svg +2 -1
  38. package/src/assets/icons/sprite/call-end.svg +2 -2
  39. package/src/assets/icons/sprite/call-inbound--filled.svg +2 -3
  40. package/src/assets/icons/sprite/call-inbound.svg +2 -2
  41. package/src/assets/icons/sprite/call-missed--filled.svg +2 -2
  42. package/src/assets/icons/sprite/call-missed.svg +2 -2
  43. package/src/assets/icons/sprite/call-outbound--filled.svg +2 -2
  44. package/src/assets/icons/sprite/call-outbound.svg +2 -2
  45. package/src/assets/icons/sprite/call-ringing--filled.svg +3 -4
  46. package/src/assets/icons/sprite/call-ringing.svg +3 -2
  47. package/src/assets/icons/sprite/call-transfer--filled.svg +2 -2
  48. package/src/assets/icons/sprite/call-transfer.svg +2 -2
  49. package/src/assets/icons/sprite/call.svg +1 -2
  50. package/src/components/transitions/__tests__/ExpandTransition.spec.js +15 -0
  51. package/src/components/transitions/__tests__/WtReplaceTransition.spec.js +66 -0
  52. package/src/components/transitions/__tests__/WtTransition.spec.js +35 -0
  53. package/src/components/wt-action-bar/WtActionBarActionsOrder.js +1 -1
  54. package/src/components/wt-action-bar/__tests__/WtActionBar.spec.js +121 -0
  55. package/src/components/wt-action-bar/wt-action-bar.vue +57 -33
  56. package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +65 -4
  57. package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +81 -2
  58. package/src/components/wt-avatar/__tests__/WtAvatar.spec.js +111 -0
  59. package/src/components/wt-badge/__tests__/WtBadge.spec.js +80 -0
  60. package/src/components/wt-badge-new/__tests__/WtBadge.spec.js +61 -0
  61. package/src/components/wt-breadcrumb/__tests__/WtBreadcrumb.spec.js +117 -0
  62. package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +37 -5
  63. package/src/components/wt-call-media-metric/__tests__/WtCallMediaMetric.spec.js +84 -0
  64. package/src/components/wt-card/__tests__/WtCard.spec.js +20 -0
  65. package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +63 -0
  66. package/src/components/wt-chip/__tests__/WtChip.spec.js +32 -0
  67. package/src/components/wt-confirm-dialog/__tests__/WtConfirmDialog.spec.js +92 -0
  68. package/src/components/wt-context-menu/__tests__/WtContextMenu.spec.js +146 -1
  69. package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +57 -0
  70. package/src/components/wt-datepicker/__tests__/WtDatepicker.spec.js +53 -0
  71. package/src/components/wt-datetime-text/__tests__/WtDatetimeText.spec.js +49 -0
  72. package/src/components/wt-divider/__tests__/WtDivider.spec.js +30 -0
  73. package/src/components/wt-dual-panel/__tests__/WtDualPanel.spec.js +120 -0
  74. package/src/components/wt-dummy/__tests__/WtDummy.spec.js +63 -1
  75. package/src/components/wt-empty/__tests__/WtEmpty.spec.js +84 -0
  76. package/src/components/wt-error-page/__tests__/WtErrorPage.spec.js +60 -0
  77. package/src/components/wt-expansion-card/__tests__/WtExpansionCard.spec.js +63 -0
  78. package/src/components/wt-expansion-panel/__tests__/WtExpansionPanel.spec.js +48 -9
  79. package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +81 -10
  80. package/src/components/wt-hint/__tests__/WtHint.spec.js +44 -1
  81. package/src/components/wt-icon/__tests__/WtIcon.spec.js +29 -0
  82. package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +79 -0
  83. package/src/components/wt-icon-action/wt-icon-action.vue +1 -1
  84. package/src/components/wt-icon-btn/__tests__/WtIconBtn.spec.js +46 -0
  85. package/src/components/wt-image/__tests__/WtImage.spec.js +83 -0
  86. package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +23 -0
  87. package/src/components/wt-input-number/__tests__/WtInputNumber.spec.js +77 -0
  88. package/src/components/wt-input-text/__tests__/WtInputText.spec.js +85 -0
  89. package/src/components/wt-intersection-observer/__tests__/WtIntersectionObserver.spec.js +24 -3
  90. package/src/components/wt-item-link/__tests__/WtItemLink.spec.js +93 -1
  91. package/src/components/wt-label/__tests__/WtLabel.spec.js +49 -1
  92. package/src/components/wt-load-bar/__tests__/WtLoadBar.spec.js +49 -0
  93. package/src/components/wt-loader/__tests__/WtLoader.spec.js +26 -1
  94. package/src/components/wt-logo/__tests__/WtLogo.spec.js +55 -0
  95. package/src/components/wt-menubar/__tests__/WtMenubar.spec.js +30 -0
  96. package/src/components/wt-message/__tests__/WtMessage.spec.js +46 -0
  97. package/src/components/wt-multi-select/__tests__/WtMultiSelect.spec.js +106 -0
  98. package/src/components/wt-page-header/__tests__/WtPageHeader.spec.js +111 -0
  99. package/src/components/wt-password/__tests__/WtPassword.spec.js +107 -0
  100. package/src/components/wt-popover/__tests__/WtPopover.spec.js +73 -0
  101. package/src/components/wt-progress-bar/__tests__/WtProgressBar.spec.js +34 -0
  102. package/src/components/wt-radio/__tests__/WtRadio.spec.js +45 -0
  103. package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +48 -0
  104. package/src/components/wt-search-bar/__tests__/WtSearchBar.spec.js +74 -13
  105. package/src/components/wt-single-select/__tests__/WtSingleSelect.spec.js +117 -0
  106. package/src/components/wt-slider/__tests__/WtSlider.spec.js +100 -0
  107. package/src/components/wt-stepper/__tests__/WtStepper.spec.js +105 -0
  108. package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +47 -0
  109. package/src/components/wt-table/__tests__/WtTable.spec.js +237 -0
  110. package/src/components/wt-table-actions/__tests__/WtTableActions.spec.js +153 -1
  111. package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +147 -0
  112. package/src/components/wt-tabs/__tests__/WtTabs.spec.js +55 -0
  113. package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +49 -0
  114. package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +29 -0
  115. package/src/components/wt-tree/__tests__/WtTree.spec.js +126 -2
  116. package/src/components/wt-tree-line/__tests__/WtTreeLine.spec.js +205 -0
  117. package/src/components/wt-tree-table/__tests__/WtTreeTable.spec.js +155 -0
  118. package/src/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.js +176 -0
  119. package/src/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.js +82 -0
  120. package/src/enums/IconAction/{IconAction.enum.js → IconAction.ts} +4 -2
  121. package/src/enums/index.ts +1 -1
  122. package/src/modules/ObjectPermissions/components/_internal/permissions-tab-content.vue +1 -1
  123. package/types/.tsbuildinfo +1 -1
  124. package/types/components/wt-action-bar/wt-action-bar.vue.d.ts +349 -105
  125. package/types/components/wt-datetime-text/__tests__/WtDatetimeText.spec.d.ts +1 -0
  126. package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +1 -0
  127. package/types/components/wt-dual-panel/__tests__/WtDualPanel.spec.d.ts +1 -0
  128. package/types/components/wt-empty/__tests__/WtEmpty.spec.d.ts +1 -0
  129. package/types/components/wt-error-page/__tests__/WtErrorPage.spec.d.ts +1 -0
  130. package/types/components/wt-expansion-card/__tests__/WtExpansionCard.spec.d.ts +1 -0
  131. package/types/components/wt-image/__tests__/WtImage.spec.d.ts +1 -0
  132. package/types/components/wt-input-number/__tests__/WtInputNumber.spec.d.ts +1 -0
  133. package/types/components/wt-input-text/__tests__/WtInputText.spec.d.ts +1 -0
  134. package/types/components/wt-logo/__tests__/WtLogo.spec.d.ts +1 -0
  135. package/types/components/wt-menubar/__tests__/WtMenubar.spec.d.ts +1 -0
  136. package/types/components/wt-message/__tests__/WtMessage.spec.d.ts +1 -0
  137. package/types/components/wt-multi-select/__tests__/WtMultiSelect.spec.d.ts +1 -0
  138. package/types/components/wt-page-header/__tests__/WtPageHeader.spec.d.ts +1 -0
  139. package/types/components/wt-password/__tests__/WtPassword.spec.d.ts +1 -0
  140. package/types/components/wt-popover/__tests__/WtPopover.spec.d.ts +1 -0
  141. package/types/components/wt-single-select/__tests__/WtSingleSelect.spec.d.ts +1 -0
  142. package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +1 -0
  143. package/types/components/wt-stepper/__tests__/WtStepper.spec.d.ts +1 -0
  144. package/types/components/wt-table/__tests__/WtTable.spec.d.ts +1 -0
  145. package/types/components/wt-tree-line/__tests__/WtTreeLine.spec.d.ts +1 -0
  146. package/types/components/wt-tree-table/__tests__/WtTreeTable.spec.d.ts +1 -0
  147. package/types/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.d.ts +1 -0
  148. package/types/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.d.ts +1 -0
  149. package/types/enums/IconAction/IconAction.d.ts +31 -0
  150. package/types/enums/index.d.ts +1 -1
  151. package/dist/wt-action-bar-D4wDtBqb.js +0 -87
  152. package/src/components/wt-action-bar/__tests__/wt-action-bar.spec.js +0 -10
  153. package/src/components/wt-avatar/__tests__/wt-avatar.spec.js +0 -10
  154. package/src/components/wt-badge/__tests__/wt-badge.spec.js +0 -10
  155. package/src/components/wt-breadcrumb/__tests__/wt-breadcrumb.spec.js +0 -14
  156. package/src/components/wt-dual-panel/__tests__/WtDualPanel.js +0 -62
  157. package/src/components/wt-empty/__tests__/wt-empty.spec.js +0 -10
  158. package/src/components/wt-error-page/__tests__/wt-error-page.spec.js +0 -30
  159. package/src/components/wt-image/__tests__/wt-image.spec.js +0 -10
  160. package/src/components/wt-logo/__tests__/wt-logo.spec.js +0 -10
  161. package/src/components/wt-page-header/__tests__/wt-page-header.spec.js +0 -10
  162. package/src/components/wt-stepper/__tests__/WtStepper.spec.vue.js +0 -19
  163. package/types/enums/IconAction/IconAction.enum.d.ts +0 -30
  164. /package/types/components/{wt-action-bar/__tests__/wt-action-bar.spec.d.ts → transitions/__tests__/WtReplaceTransition.spec.d.ts} +0 -0
  165. /package/types/components/{wt-avatar/__tests__/wt-avatar.spec.d.ts → transitions/__tests__/WtTransition.spec.d.ts} +0 -0
  166. /package/types/components/{wt-badge/__tests__/wt-badge.spec.d.ts → wt-action-bar/__tests__/WtActionBar.spec.d.ts} +0 -0
  167. /package/types/components/{wt-breadcrumb/__tests__/wt-breadcrumb.spec.d.ts → wt-avatar/__tests__/WtAvatar.spec.d.ts} +0 -0
  168. /package/types/components/{wt-empty/__tests__/wt-empty.spec.d.ts → wt-badge/__tests__/WtBadge.spec.d.ts} +0 -0
  169. /package/types/components/{wt-dual-panel/__tests__/WtDualPanel.d.ts → wt-badge-new/__tests__/WtBadge.spec.d.ts} +0 -0
  170. /package/types/components/{wt-error-page/__tests__/wt-error-page.spec.d.ts → wt-breadcrumb/__tests__/WtBreadcrumb.spec.d.ts} +0 -0
  171. /package/types/components/{wt-image/__tests__/wt-image.spec.d.ts → wt-call-media-metric/__tests__/WtCallMediaMetric.spec.d.ts} +0 -0
  172. /package/types/components/{wt-logo/__tests__/wt-logo.spec.d.ts → wt-card/__tests__/WtCard.spec.d.ts} +0 -0
  173. /package/types/components/{wt-page-header/__tests__/wt-page-header.spec.d.ts → wt-confirm-dialog/__tests__/WtConfirmDialog.spec.d.ts} +0 -0
  174. /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
- it('emits "opened" event when opened', () => {
11
- const wrapper = shallowMount(WtExpansionPanel);
12
- wrapper.vm.opened = false;
13
- wrapper.find('.wt-expansion-panel-header').trigger('click');
14
- expect(wrapper.emitted().opened).toBeTruthy();
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
- it('emits "closed" event when closed', () => {
27
+
28
+ it('is open by default and emits "closed" on first click', async () => {
17
29
  const wrapper = shallowMount(WtExpansionPanel);
18
- wrapper.vm.opened = true;
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
- it('emits "reset" event at wt-table-actions "filterReset" event', () => {
11
- const wrapper = shallowMount(FiltersPanelWrapper);
12
- wrapper.vm.tableActionsHandler('filterReset');
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
- it(`toggles "filters-panel-wrapper--opened" class at
16
- wt-table-actions "settings" event`, async () => {
17
- const wrapper = shallowMount(FiltersPanelWrapper);
18
- const toggleSpy = vi.spyOn(wrapper.vm, 'toggleFiltersExpansion');
19
- wrapper.vm.tableActionsHandler('settings');
20
- expect(toggleSpy).toHaveBeenCalled();
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/IconAction/IconAction.enum.js';
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
  });