@webitel/ui-sdk 26.4.17 → 26.4.19

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 (185) hide show
  1. package/dist/displayText-Cbh4IOfM.js +5 -0
  2. package/dist/{index-eEFER0lI.js → index-CeADjYK9.js} +1 -1
  3. package/dist/{index-B_bOPX3o.js → index-DZ_bvNVs.js} +1 -1
  4. package/dist/{install-C_4PcYy4.js → install-Dofcp90y.js} +1749 -1752
  5. package/dist/{isObject-Bc_zejYi.js → isObject-B2zd2O3f.js} +1 -1
  6. package/dist/ui-sdk.css +1 -1
  7. package/dist/ui-sdk.js +1 -1
  8. package/dist/ui-sdk.umd.cjs +232 -232
  9. package/dist/{useVidstackSrc-BjBi-Z6a.js → useVidstackSrc-D9uo15mF.js} +3 -4
  10. package/dist/{vidstack-Bq6c3Bam-Do_GZqV0.js → vidstack-Bq6c3Bam-Bs73fRdp.js} +3 -3
  11. package/dist/{vidstack-D2pY00kU-DtEQuJNJ.js → vidstack-D2pY00kU-BVC5bxHL.js} +3 -3
  12. package/dist/{vidstack-DDXt6fpN-BjUme5OE.js → vidstack-DDXt6fpN-DA-lnlhX.js} +2 -2
  13. package/dist/{vidstack-D_-9AA6_-BUgV5EDC.js → vidstack-D_-9AA6_-C0QZLaX5.js} +2 -2
  14. package/dist/{vidstack-DqAw8m9J-D5-emHfz.js → vidstack-DqAw8m9J-DAs7LwX_.js} +1 -1
  15. package/dist/{vidstack-audio-DmysFuAQ.js → vidstack-audio-BrbZotHa.js} +2 -2
  16. package/dist/{vidstack-dash-CF4d8BuX.js → vidstack-dash-KNjyvq2R.js} +4 -4
  17. package/dist/{vidstack-google-cast-CNPyXY9S.js → vidstack-google-cast-DMZQ1jRD.js} +4 -4
  18. package/dist/{vidstack-hls-BLaXkLiF.js → vidstack-hls-BfOysul0.js} +4 -4
  19. package/dist/{vidstack-video-v_RKZWR5.js → vidstack-video-PWMSQ3Gk.js} +3 -3
  20. package/dist/{vidstack-vimeo-BCNYIpmz.js → vidstack-vimeo-C5Khtd48.js} +4 -4
  21. package/dist/{vidstack-youtube-C1DaWOJU.js → vidstack-youtube-CPcpsir2.js} +3 -3
  22. package/dist/{wt-action-bar-Ckg4xWY1.js → wt-action-bar-By55sdZf.js} +1 -1
  23. package/dist/{wt-button-select-DHqtUP4R.js → wt-button-select-C34W0lYV.js} +1 -1
  24. package/dist/{wt-chat-emoji-BVMxNx8W.js → wt-chat-emoji-DjgWXA_2.js} +2 -2
  25. package/dist/{wt-confirm-dialog-BNjF-amp.js → wt-confirm-dialog-GNka4gxY.js} +1 -1
  26. package/dist/{wt-context-menu-DkK9-qLI.js → wt-context-menu-Bjl5aGzG.js} +1 -1
  27. package/dist/{wt-copy-action-7hL0mEvW.js → wt-copy-action-Xo2DsqJZ.js} +1 -1
  28. package/dist/{wt-datepicker-Bvde1_4k.js → wt-datepicker-CL3jLy5h.js} +1 -1
  29. package/dist/wt-display-chip-items-CCNWd5Nt.js +47 -0
  30. package/dist/{wt-dual-panel-C6E7X3c8.js → wt-dual-panel-CMUeBmf-.js} +1 -1
  31. package/dist/{wt-dummy-oCvw9ZAO.js → wt-dummy-BOgeleXm.js} +1 -1
  32. package/dist/{wt-error-page-BWRGUdsV.js → wt-error-page-Ctl0-_Yp.js} +1 -1
  33. package/dist/{wt-expansion-card-DqdyzBFB.js → wt-expansion-card-BCOBdTuS.js} +1 -1
  34. package/dist/{wt-expansion-panel-CGYB7-8V.js → wt-expansion-panel-C7W_5dxd.js} +1 -1
  35. package/dist/{wt-filters-panel-wrapper-BdWYuFBU.js → wt-filters-panel-wrapper-CkLHeV4o.js} +1 -1
  36. package/dist/{wt-galleria-BBSNSwsR.js → wt-galleria-Bls8Xxh4.js} +2 -2
  37. package/dist/{wt-navigation-menu-CubDPnaE.js → wt-navigation-menu-CFPMD9o1.js} +1 -1
  38. package/dist/{wt-notifications-bar-B9gUZbnG.js → wt-notifications-bar-BTDN7hSn.js} +2 -2
  39. package/dist/{wt-pagination-Dafsnmhz.js → wt-pagination-DtjeKcpO.js} +1 -1
  40. package/dist/{wt-player-DxvKDEYJ.js → wt-player-Co3Ib7qU.js} +13 -13
  41. package/dist/wt-screen-recordings-action-CmY7R2B-.js +55 -0
  42. package/dist/{wt-search-bar-BSTKSDBo.js → wt-search-bar-CmN8Nq-n.js} +1 -1
  43. package/dist/{wt-selection-popup-D_mDRYjd.js → wt-selection-popup-BNKNa5jy.js} +1 -1
  44. package/dist/{wt-start-page-BYGMWDsS.js → wt-start-page-BC4r_EPK.js} +1 -1
  45. package/dist/{wt-status-select-BDFd1JE-.js → wt-status-select-CBq_ihcS.js} +11 -14
  46. package/dist/{wt-stepper-Db5aEz47.js → wt-stepper-DvmRISSE.js} +1 -1
  47. package/dist/{wt-table-92BKexHp.js → wt-table-BDnXcyai.js} +14 -14
  48. package/dist/{wt-table-actions-BTmBjf1Q.js → wt-table-actions-52X557c8.js} +1 -1
  49. package/dist/{wt-table-column-select-abILUxUr.js → wt-table-column-select-vKGXHla2.js} +2 -2
  50. package/dist/{wt-tabs-B21sWbPs.js → wt-tabs-zXlsvaeU.js} +16 -17
  51. package/dist/{wt-tags-input-DNA22dSR.js → wt-tags-input-B8w0KXPv.js} +2 -2
  52. package/dist/{wt-timepicker-CgowHF74.js → wt-timepicker-Cm4aLsPK.js} +1 -1
  53. package/dist/{wt-tree-CvHw827i.js → wt-tree-IVOTwA3x.js} +4 -4
  54. package/dist/{wt-tree-table-DWgEjAUG.js → wt-tree-table-zA7HHvru.js} +3 -3
  55. package/dist/{wt-type-extension-value-input-BvHowj58.js → wt-type-extension-value-input-DTmneCoP.js} +4 -7
  56. package/dist/{wt-vidstack-player-BnK8NLH3.js → wt-vidstack-player-DHmGgiDL.js} +13 -13
  57. package/package.json +7 -3
  58. package/src/api/clients/agents/agentChats.js +0 -1
  59. package/src/api/clients/agents/agents.js +1 -1
  60. package/src/api/clients/caseSources/caseSources.ts +1 -1
  61. package/src/api/clients/chatGateways/defaults/webChatGateway.js +5 -5
  62. package/src/api/clients/contactGroups/contactGroups.js +0 -1
  63. package/src/api/clients/queues/queues.js +16 -22
  64. package/src/api/clients/users/__tests__/users.spec.js +1 -1
  65. package/src/api/clients/users/users.js +10 -2
  66. package/src/api/clients//321/201ontacts/contacts.js +0 -1
  67. package/src/api/clients//321/201ontacts/index.js +1 -1
  68. package/src/api/defaults/getDefaultGetListResponse/getDefaultGetListResponse.js +1 -1
  69. package/src/api/transformers/addQueryParamsToUrl/addQueryParamsToUrl.transformer.js +2 -2
  70. package/src/api/transformers/sanitize/sanitize.transformer.js +2 -4
  71. package/src/api/websocket/WebSocketClientController.ts +6 -4
  72. package/src/components/index.js +10 -2
  73. package/src/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue +72 -0
  74. package/src/components/wt-app-header/wt-app-navigator.vue +8 -11
  75. package/src/components/wt-button/__tests__/WtButton.spec.js +10 -5
  76. package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +13 -16
  77. package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +6 -2
  78. package/src/components/wt-chip/__tests__/WtChip.spec.js +3 -3
  79. package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +4 -17
  80. package/src/components/wt-galleria/wt-galleria.vue +1 -1
  81. package/src/components/wt-icon/__tests__/WtIcon.spec.js +19 -2
  82. package/src/components/wt-intersection-observer/wt-intersection-observer.vue +1 -1
  83. package/src/components/wt-pagination/__tests__/WtPagination.spec.js +80 -16
  84. package/src/components/wt-player/src/components/buttons/mute-button.vue +0 -1
  85. package/src/components/wt-radio/__tests__/WtRadio.spec.js +8 -2
  86. package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +98 -0
  87. package/src/components/wt-rounded-action/_variables.css +0 -3
  88. package/src/components/wt-select/mixins/multiselectMixin.js +0 -1
  89. package/src/components/wt-select/multiselect.css +2 -0
  90. package/src/components/wt-select/wt-select-v2.vue +3 -2
  91. package/src/components/wt-status-select/wt-status-select.vue +2 -4
  92. package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +9 -11
  93. package/src/components/wt-switcher/wt-switcher.vue +1 -1
  94. package/src/components/wt-table/wt-table.vue +1 -1
  95. package/src/components/wt-tabs/wt-tabs.vue +1 -2
  96. package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +2 -2
  97. package/src/components/wt-textarea/wt-textarea.vue +3 -4
  98. package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +18 -1
  99. package/src/components/wt-timepicker/__tests__/WtTimepicker.spec.js +9 -15
  100. package/src/components/wt-tree/__tests__/WtTree.spec.js +1 -1
  101. package/src/components/wt-tree/wt-tree.vue +92 -60
  102. package/src/components/wt-tree-line/wt-tree-line.vue +2 -2
  103. package/src/components/wt-tree-table/wt-tree-table.vue +90 -84
  104. package/src/components/wt-tree-table-row/wt-tree-table-row.vue +2 -2
  105. package/src/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue +2 -2
  106. package/src/components/wt-vidstack-player/composables/useVidstackSrc.ts +1 -1
  107. package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +1 -1
  108. package/src/composables/useCard/useCardComponent.js +1 -1
  109. package/src/composables/useInputControl/useInputControl.ts +1 -1
  110. package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +60 -80
  111. package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +1 -1
  112. package/src/composables/useTableColumnDrag/useTableColumnDrag.ts +1 -1
  113. package/src/enums/index.ts +0 -1
  114. package/src/install.ts +1 -1
  115. package/src/locale/kz/kz.js +2 -4
  116. package/src/locale/pl/pl.js +2 -4
  117. package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +1 -1
  118. package/src/modules/AgentPdfs/components/agent-pdfs-tab.vue +104 -96
  119. package/src/modules/AgentStatusSelect/api/agent-status.js +9 -13
  120. package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +6 -47
  121. package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +31 -3
  122. package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +16 -10
  123. package/src/modules/AuditForm/components/audit-form.vue +1 -1
  124. package/src/modules/AuditForm/components/form-answers/answer-editing-info/audit-form-answer-editing-info.vue +1 -1
  125. package/src/modules/AuditForm/components/form-questions/options/__tests__/audit-form-question-options.spec.js +4 -6
  126. package/src/modules/AuditForm/components/form-questions/score/__tests__/audit-form-question-score.spec.js +2 -2
  127. package/src/modules/CSVExport/XLSExport.js +5 -7
  128. package/src/modules/CSVExport/composables/useCSVExport.ts +3 -3
  129. package/src/modules/CSVExport/mixins/exportCSVMixin.js +1 -5
  130. package/src/modules/CSVExport/mixins/exportXLSMixin.js +1 -5
  131. package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +7 -51
  132. package/src/modules/FilesExport/composables/useFilesExport.ts +1 -1
  133. package/src/modules/FilesExport/types/types.ts +1 -1
  134. package/src/modules/Filters/store/FiltersStoreModule.js +27 -27
  135. package/src/modules/Notifications/store/NotificationsStoreModule.js +1 -1
  136. package/src/modules/ObjectPermissions/_internals/store/helpers/createObjectPermissionsStoreModule.js +0 -4
  137. package/src/modules/ObjectPermissions/components/permissions-tab.vue +5 -7
  138. package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +2 -2
  139. package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +1 -1
  140. package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +5 -6
  141. package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +12 -8
  142. package/src/modules/TableStoreModule/store/TableStoreModule.js +10 -18
  143. package/src/modules/UploadCsvPopup/scripts/normalizeCSVData.ts +9 -9
  144. package/src/modules/UploadCsvPopup/scripts/parseCSV.ts +1 -1
  145. package/src/modules/Userinfo/composables/createUserAccessControl.ts +2 -2
  146. package/src/modules/Userinfo/composables/types/CreateUserAccessControl.d.ts +2 -4
  147. package/src/modules/Userinfo/scripts/utils.ts +4 -2
  148. package/src/scripts/compareSize.ts +7 -6
  149. package/src/store/new/modules/tableStoreModule/tableStoreModule.js +17 -29
  150. package/src/validations/vuelidate/validators/decimalValidator.js +2 -1
  151. package/src/validations/vuelidate/validators/websocketValidator/websocketValidator.js +1 -1
  152. package/types/api/clients//321/201ontacts/index.d.ts +2 -2
  153. package/types/api/defaults/getDefaultGetListResponse/getDefaultGetListResponse.d.ts +1 -1
  154. package/types/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue.d.ts +10 -0
  155. package/types/components/wt-switcher/wt-switcher.vue.d.ts +1 -1
  156. package/types/components/wt-table/wt-table.vue.d.ts +1 -1
  157. package/types/components/wt-textarea/wt-textarea.vue.d.ts +3 -4
  158. package/types/components/wt-tree/wt-tree.vue.d.ts +6 -6
  159. package/types/components/wt-tree-line/wt-tree-line.vue.d.ts +2 -2
  160. package/types/components/wt-tree-table/wt-tree-table.vue.d.ts +2 -2
  161. package/types/components/wt-tree-table-row/wt-tree-table-row.vue.d.ts +1 -1
  162. package/types/install.d.ts +1 -2
  163. package/types/modules/AgentPdfs/components/agent-pdfs-tab.vue.d.ts +1 -1
  164. package/types/modules/CSVExport/composables/useCSVExport.d.ts +3 -3
  165. package/types/modules/FilesExport/composables/useFilesExport.d.ts +1 -1
  166. package/types/modules/FilesExport/types/types.d.ts +1 -1
  167. package/types/modules/Filters/store/FiltersStoreModule.d.ts +2 -2
  168. package/types/modules/Notifications/store/NotificationsStoreModule.d.ts +1 -1
  169. package/types/modules/TableStoreModule/store/TableStoreModule.d.ts +2 -2
  170. package/types/modules/Userinfo/composables/createUserAccessControl.d.ts +2 -2
  171. package/types/modules/Userinfo/scripts/utils.d.ts +1 -1
  172. package/types/store/new/modules/tableStoreModule/tableStoreModule.d.ts +2 -2
  173. package/dist/wt-display-chip-items-DPoEtUZ-.js +0 -46
  174. package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +0 -15
  175. package/src/components/wt-divider/__tests__/WtDivider.spec.js +0 -10
  176. package/src/components/wt-slider/__tests__/WtSlider.spec.js +0 -10
  177. package/src/components/wt-table/__tests__/WtTable.spec.js +0 -140
  178. package/src/modules/Filters/components/__tests__/filter-pagination.spec.js +0 -109
  179. package/src/modules/Filters/components/__tests__/filter-table-fields.spec.js +0 -112
  180. package/types/components/wt-copy-action/__tests__/WtCopyAction.spec.d.ts +0 -1
  181. package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +0 -1
  182. package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +0 -1
  183. package/types/components/wt-table/__tests__/WtTable.spec.d.ts +0 -1
  184. package/types/modules/Filters/components/__tests__/filter-pagination.spec.d.ts +0 -1
  185. package/types/modules/Filters/components/__tests__/filter-table-fields.spec.d.ts +0 -1
@@ -135,17 +135,14 @@ const order = [
135
135
 
136
136
  const formattedApps = computed(() =>
137
137
  props.apps
138
- .reduce(
139
- (apps, app) => [
140
- ...apps,
141
- {
142
- ...app,
143
- img: props.darkMode ? pics[app.name].dark : pics[app.name].light,
144
- currentApp: props.currentApp === app.name,
145
- },
146
- ],
147
- [],
148
- )
138
+ .reduce((apps, app) => {
139
+ apps.push({
140
+ ...app,
141
+ img: props.darkMode ? pics[app.name].dark : pics[app.name].light,
142
+ currentApp: props.currentApp === app.name,
143
+ });
144
+ return apps;
145
+ }, [])
149
146
  .sort((a, b) => order.indexOf(a.name) - order.indexOf(b.name)),
150
147
  );
151
148
 
@@ -1,6 +1,5 @@
1
- import { shallowMount } from '@vue/test-utils';
1
+ import { mount, shallowMount } from '@vue/test-utils';
2
2
 
3
- import WtLoader from '../../wt-loader/wt-loader.vue';
4
3
  import WtButton from '../wt-button.vue';
5
4
 
6
5
  describe('WtButton', () => {
@@ -11,12 +10,12 @@ describe('WtButton', () => {
11
10
 
12
11
  it('renders a button content via default slot', () => {
13
12
  const content = 'button content';
14
- const wrapper = shallowMount(WtButton, {
13
+ const wrapper = mount(WtButton, {
15
14
  slots: {
16
15
  default: content,
17
16
  },
18
17
  });
19
- expect(wrapper.find('.wt-button').text()).toBe(content);
18
+ expect(wrapper.text()).toContain(content);
20
19
  });
21
20
 
22
21
  it('renders button spinner', () => {
@@ -25,6 +24,12 @@ describe('WtButton', () => {
25
24
  loading: true,
26
25
  },
27
26
  });
28
- expect(wrapper.findComponent(WtLoader).exists()).toBe(true);
27
+ expect(wrapper.classes('p-button--loading')).toBe(true);
28
+ });
29
+
30
+ it('emits click event', async () => {
31
+ const wrapper = shallowMount(WtButton);
32
+ await wrapper.trigger('click');
33
+ expect(wrapper.emitted().click).toBeTruthy();
29
34
  });
30
35
  });
@@ -11,13 +11,20 @@ global.ResizeObserver = vi.fn().mockImplementation(() => ({
11
11
 
12
12
  describe('WtSelectButton', () => {
13
13
  it('renders a component', () => {
14
- const wrapper = shallowMount(WtSelectButton);
14
+ const wrapper = shallowMount(WtSelectButton, {
15
+ props: {
16
+ options: [],
17
+ },
18
+ });
15
19
  expect(wrapper.classes('wt-button-select')).toBe(true);
16
20
  });
17
21
 
18
22
  it('renders a button content via default slot', () => {
19
23
  const content = 'button content';
20
24
  const wrapper = mount(WtSelectButton, {
25
+ props: {
26
+ options: [],
27
+ },
21
28
  slots: {
22
29
  default: content,
23
30
  },
@@ -25,24 +32,14 @@ describe('WtSelectButton', () => {
25
32
  expect(wrapper.find('.wt-button-select__button').text()).toBe(content);
26
33
  });
27
34
 
28
- it('should rotate the arrow', async () => {
29
- const wrapper = mount(WtSelectButton, {
35
+ it('emits click from main action button', async () => {
36
+ const wrapper = shallowMount(WtSelectButton, {
30
37
  props: {
31
38
  options: [],
32
39
  },
33
40
  });
34
- const arrowBtn = wrapper
35
- .findAllComponents({
36
- name: 'wt-button',
37
- })
38
- .find((component) =>
39
- component.classes().includes('wt-button-select__select-btn'),
40
- );
41
- arrowBtn.vm.$emit('click');
42
- await wrapper.vm.$nextTick();
43
- const wtIcon = wrapper.find('.wt-button-select__select-arrow');
44
- expect(wtIcon.classes()).toContain(
45
- 'wt-button-select__select-arrow--active',
46
- );
41
+
42
+ await wrapper.find('.wt-button-select__button').trigger('click');
43
+ expect(wrapper.emitted().click).toBeTruthy();
47
44
  });
48
45
  });
@@ -7,6 +7,9 @@ import WtCheckbox from '../wt-checkbox.vue';
7
7
  describe('WtCheckbox', () => {
8
8
  it('renders a component', () => {
9
9
  const wrapper = shallowMount(WtCheckbox, {
10
+ props: {
11
+ selected: false,
12
+ },
10
13
  stubs: {
11
14
  WtLabel,
12
15
  WtIcon,
@@ -24,6 +27,7 @@ describe('WtCheckbox', () => {
24
27
  },
25
28
  props: {
26
29
  label,
30
+ selected: false,
27
31
  },
28
32
  });
29
33
  expect(wrapper.find('.wt-checkbox__label').text()).toBe(label);
@@ -40,8 +44,8 @@ describe('WtCheckbox', () => {
40
44
  selected,
41
45
  },
42
46
  });
43
- wrapper.find('.wt-checkbox__input').trigger('change');
44
- expect(wrapper.emitted().change[0]).toEqual([
47
+ wrapper.find('input[type="checkbox"]').setValue(!selected);
48
+ expect(wrapper.emitted()['update:selected'][0]).toEqual([
45
49
  !selected,
46
50
  ]);
47
51
  });
@@ -1,4 +1,4 @@
1
- import { shallowMount } from '@vue/test-utils';
1
+ import { mount, shallowMount } from '@vue/test-utils';
2
2
 
3
3
  import WtChip from '../wt-chip.vue';
4
4
 
@@ -10,11 +10,11 @@ describe('WtChip', () => {
10
10
 
11
11
  it('renders a chip content via default slot', () => {
12
12
  const content = 'chip content';
13
- const wrapper = shallowMount(WtChip, {
13
+ const wrapper = mount(WtChip, {
14
14
  slots: {
15
15
  default: content,
16
16
  },
17
17
  });
18
- expect(wrapper.find('.wt-chip').text()).toBe(content);
18
+ expect(wrapper.text()).toContain(content);
19
19
  });
20
20
  });
@@ -9,27 +9,14 @@ describe('Filters Panel Wrapper', () => {
9
9
  });
10
10
  it('emits "reset" event at wt-table-actions "filterReset" event', () => {
11
11
  const wrapper = shallowMount(FiltersPanelWrapper);
12
- wrapper
13
- .findComponent({
14
- name: 'wt-table-actions',
15
- })
16
- .vm.$emit('input', 'filterReset');
12
+ wrapper.vm.tableActionsHandler('filterReset');
17
13
  expect(wrapper.emitted().reset).toBeTruthy();
18
14
  });
19
15
  it(`toggles "filters-panel-wrapper--opened" class at
20
16
  wt-table-actions "settings" event`, async () => {
21
17
  const wrapper = shallowMount(FiltersPanelWrapper);
22
- expect(wrapper.classes().includes('filters-panel-wrapper--opened')).toBe(
23
- false,
24
- );
25
- wrapper
26
- .findComponent({
27
- name: 'wt-table-actions',
28
- })
29
- .vm.$emit('input', 'settings');
30
- await wrapper.vm.$nextTick();
31
- expect(wrapper.classes().includes('filters-panel-wrapper--opened')).toBe(
32
- true,
33
- );
18
+ const toggleSpy = vi.spyOn(wrapper.vm, 'toggleFiltersExpansion');
19
+ wrapper.vm.tableActionsHandler('settings');
20
+ expect(toggleSpy).toHaveBeenCalled();
34
21
  });
35
22
  });
@@ -192,7 +192,7 @@ const handleDelete = () => {
192
192
  watch(
193
193
  () => currentImage.value,
194
194
  (oldValue, newValue) => {
195
- if (oldValue?.src == newValue?.src) return;
195
+ if (oldValue?.src === newValue?.src) return;
196
196
  isImageOnLoad.value = true;
197
197
  },
198
198
  {
@@ -12,7 +12,7 @@ describe('WtIcon', () => {
12
12
  expect(wrapper.classes('wt-icon')).toBe(true);
13
13
  });
14
14
  it('correctly computes icon name', () => {
15
- const iconName = '#jest-bucket';
15
+ const iconName = 'jest-bucket';
16
16
  const wrapper = shallowMount(WtIcon, {
17
17
  props: {
18
18
  icon: 'bucket',
@@ -20,6 +20,23 @@ describe('WtIcon', () => {
20
20
  iconPrefix: 'jest',
21
21
  },
22
22
  });
23
- expect(wrapper.vm.iconName).toBe(iconName);
23
+ expect(wrapper.vm.iconSvg).toBe(iconName);
24
+ });
25
+
26
+ it('applies size and color classes', () => {
27
+ const wrapper = shallowMount(WtIcon, {
28
+ props: {
29
+ icon: 'bucket',
30
+ size: 'sm',
31
+ color: 'error',
32
+ },
33
+ });
34
+
35
+ expect(wrapper.classes()).toEqual(
36
+ expect.arrayContaining([
37
+ 'wt-icon--size-sm',
38
+ 'wt-icon--color-error',
39
+ ]),
40
+ );
24
41
  });
25
42
  });
@@ -27,7 +27,7 @@ const emit = defineEmits([
27
27
 
28
28
  const intersectionTarget = ref(null);
29
29
 
30
- let stopObs;
30
+ let stopObs: (() => void) | undefined;
31
31
 
32
32
  onMounted(() => {
33
33
  /**
@@ -3,42 +3,106 @@ import { mount, shallowMount } from '@vue/test-utils';
3
3
  import WtPagination from '../wt-pagination.vue';
4
4
 
5
5
  describe('WtPagination', () => {
6
+ beforeEach(() => {
7
+ vi.useFakeTimers();
8
+ });
9
+
10
+ afterEach(() => {
11
+ vi.useRealTimers();
12
+ });
13
+
6
14
  it('renders a component', () => {
7
15
  const wrapper = shallowMount(WtPagination);
8
16
  expect(wrapper.classes('wt-pagination')).toBe(true);
9
17
  });
10
18
 
11
19
  it('debounces size change event when debounce prop is true', async () => {
12
- const props = {
13
- size: '10',
14
- debounce: true,
15
- debounceDelay: 100,
16
- };
17
20
  const wrapper = shallowMount(WtPagination, {
18
- props,
21
+ props: {
22
+ size: '10',
23
+ debounce: true,
24
+ debounceDelay: 100,
25
+ },
26
+ });
27
+
28
+ await wrapper.setProps({
29
+ size: '20',
19
30
  });
20
- props.size = '20';
21
- wrapper.setProps(props);
31
+
22
32
  expect(wrapper.emitted().change).toBeFalsy();
23
- await setTimeout(() => {
24
- expect(wrapper.emitted().change[0].length).toBe(1);
25
- }, 1000);
33
+
34
+ vi.advanceTimersByTime(1000);
35
+ expect(wrapper.emitted().change ?? []).toHaveLength(1);
36
+ expect(wrapper.emitted().change[0]).toEqual([
37
+ 20,
38
+ ]);
26
39
  });
27
40
 
28
41
  it('changes pages at icon btn click', async () => {
29
42
  const wrapper = mount(WtPagination, {
30
43
  props: {
31
- isNext: true,
32
- page: 2,
44
+ prev: true,
45
+ next: true,
33
46
  },
34
47
  });
35
48
  const pageControls = wrapper.findAllComponents({
36
49
  name: 'wt-icon-btn',
37
50
  });
38
- pageControls.at(0).vm.$emit('click');
39
- pageControls.at(1).vm.$emit('click');
40
- console.info(wrapper.emitted());
51
+
52
+ pageControls[0].vm.$emit('click');
53
+ pageControls[1].vm.$emit('click');
54
+
41
55
  expect(wrapper.emitted().prev.length).toBe(1);
42
56
  expect(wrapper.emitted().next.length).toBe(1);
43
57
  });
58
+
59
+ it('resets to default size when input value is null', async () => {
60
+ const wrapper = shallowMount(WtPagination, {
61
+ props: {
62
+ size: 25,
63
+ },
64
+ });
65
+
66
+ wrapper.vm.inputHandler(null);
67
+ expect(wrapper.vm.internalSize).toBeNull();
68
+
69
+ await wrapper.vm.$nextTick();
70
+ await wrapper.vm.$nextTick();
71
+
72
+ expect(wrapper.vm.internalSize).toBe(10);
73
+ expect(wrapper.emitted().input).toBeTruthy();
74
+ expect(wrapper.emitted().input[0]).toEqual([
75
+ 10,
76
+ ]);
77
+ expect(wrapper.emitted().change).toBeTruthy();
78
+ expect(wrapper.emitted().change[0]).toEqual([
79
+ 10,
80
+ ]);
81
+ });
82
+
83
+ it('normalizes out-of-range input values to default size', async () => {
84
+ const wrapper = shallowMount(WtPagination, {
85
+ props: {
86
+ size: 11,
87
+ },
88
+ });
89
+
90
+ wrapper.vm.inputHandler(2000);
91
+ wrapper.vm.inputHandler(-1);
92
+ await wrapper.vm.$nextTick();
93
+
94
+ expect(wrapper.emitted().input).toEqual([
95
+ [
96
+ 10,
97
+ ],
98
+ [
99
+ 10,
100
+ ],
101
+ ]);
102
+ expect(wrapper.emitted().change).toEqual([
103
+ [
104
+ 10,
105
+ ],
106
+ ]);
107
+ });
44
108
  });
@@ -6,7 +6,6 @@
6
6
  </template>
7
7
 
8
8
  <script setup lang="ts">
9
-
10
9
  </script>
11
10
 
12
11
  <style scoped>
@@ -7,6 +7,10 @@ import WtRadio from '../wt-radio.vue';
7
7
  describe('WtRadio', () => {
8
8
  it('renders a component', () => {
9
9
  const wrapper = shallowMount(WtRadio, {
10
+ props: {
11
+ selected: '',
12
+ value: 'v',
13
+ },
10
14
  stubs: {
11
15
  WtLabel,
12
16
  WtIcon,
@@ -24,6 +28,8 @@ describe('WtRadio', () => {
24
28
  },
25
29
  props: {
26
30
  label,
31
+ selected: '',
32
+ value: 'v',
27
33
  },
28
34
  });
29
35
  expect(wrapper.find('.wt-radio__label').text()).toBe(label);
@@ -42,8 +48,8 @@ describe('WtRadio', () => {
42
48
  value,
43
49
  },
44
50
  });
45
- wrapper.find('.wt-radio__input').trigger('input');
46
- expect(wrapper.emitted().input[0]).toEqual([
51
+ wrapper.find('input[type="radio"]').setValue();
52
+ expect(wrapper.emitted()['update:selected'][0]).toEqual([
47
53
  value,
48
54
  ]);
49
55
  });
@@ -11,4 +11,102 @@ describe('WtRoundedAction', () => {
11
11
  });
12
12
  expect(wrapper.classes('wt-rounded-action')).toBe(true);
13
13
  });
14
+
15
+ it('applies state classes from props', () => {
16
+ const wrapper = shallowMount(WtRoundedAction, {
17
+ props: {
18
+ icon: 'call',
19
+ active: true,
20
+ disabled: true,
21
+ rounded: true,
22
+ wide: true,
23
+ size: 'sm',
24
+ },
25
+ });
26
+
27
+ expect(wrapper.classes()).toEqual(
28
+ expect.arrayContaining([
29
+ 'wt-rounded-action--active',
30
+ 'wt-rounded-action--disabled',
31
+ 'wt-rounded-action--rounded',
32
+ 'wt-rounded-action--wide',
33
+ 'wt-rounded-action--size-sm',
34
+ ]),
35
+ );
36
+ });
37
+
38
+ it('emits click event', async () => {
39
+ const wrapper = shallowMount(WtRoundedAction, {
40
+ props: {
41
+ icon: 'call',
42
+ },
43
+ });
44
+
45
+ await wrapper.trigger('click');
46
+ expect(wrapper.emitted().click).toHaveLength(1);
47
+ });
48
+
49
+ it('shows loader when loading is true', () => {
50
+ const wrapper = shallowMount(WtRoundedAction, {
51
+ props: {
52
+ icon: 'call',
53
+ loading: true,
54
+ },
55
+ });
56
+
57
+ expect(
58
+ wrapper
59
+ .findComponent({
60
+ name: 'wt-loader',
61
+ })
62
+ .exists(),
63
+ ).toBe(true);
64
+ expect(
65
+ wrapper
66
+ .findComponent({
67
+ name: 'wt-icon',
68
+ })
69
+ .exists(),
70
+ ).toBe(false);
71
+ });
72
+
73
+ it('hides loader 1s after loading becomes false', async () => {
74
+ vi.useFakeTimers();
75
+ const wrapper = shallowMount(WtRoundedAction, {
76
+ props: {
77
+ icon: 'call',
78
+ loading: true,
79
+ },
80
+ });
81
+
82
+ await wrapper.setProps({
83
+ loading: false,
84
+ });
85
+ expect(
86
+ wrapper
87
+ .findComponent({
88
+ name: 'wt-loader',
89
+ })
90
+ .exists(),
91
+ ).toBe(true);
92
+
93
+ vi.advanceTimersByTime(1000);
94
+ await wrapper.vm.$nextTick();
95
+
96
+ expect(
97
+ wrapper
98
+ .findComponent({
99
+ name: 'wt-loader',
100
+ })
101
+ .exists(),
102
+ ).toBe(false);
103
+ expect(
104
+ wrapper
105
+ .findComponent({
106
+ name: 'wt-icon',
107
+ })
108
+ .exists(),
109
+ ).toBe(true);
110
+ vi.useRealTimers();
111
+ });
14
112
  });
@@ -12,6 +12,3 @@
12
12
 
13
13
  --rounded-action-active-color: var(--dp-10-surface-color);
14
14
  }
15
-
16
- :root.theme--dark {
17
- }
@@ -1,7 +1,6 @@
1
1
  import VueMultiselect from 'vue-multiselect';
2
2
  import { ObserveVisibility } from 'vue-observe-visibility';
3
3
 
4
- import validationMixin from '../../../mixins/validationMixin/validationMixin.js';
5
4
  import debounce from '../../../scripts/debounce.js';
6
5
  import isEmpty from '../../../scripts/isEmpty.js';
7
6
  import labelUsageMixin from '../../wt-label/mixins/labelUsageMixin.js';
@@ -1,3 +1,5 @@
1
+ /* THIS FILE IS ADDED TO BIOME IGNORE coz it fails to parse Vue :deep() selector*/
2
+
1
3
  :deep(.multiselect) {
2
4
  position: relative;
3
5
  cursor: pointer;
@@ -140,9 +140,10 @@ const search = async (event) => {
140
140
  console.log('event.query', event);
141
141
 
142
142
  if (!isApiMode.value) {
143
- return (suggestions.value = [
143
+ suggestions.value = [
144
144
  ...props.options,
145
- ]);
145
+ ];
146
+ return suggestions.value;
146
147
  }
147
148
 
148
149
  const fetchedOptions = await fetchOptions({
@@ -100,10 +100,8 @@ export default {
100
100
  // skip breakout option
101
101
  return options;
102
102
  }
103
- return [
104
- ...options,
105
- opt,
106
- ];
103
+ options.push(opt);
104
+ return options;
107
105
  }, []);
108
106
  },
109
107
  duration() {
@@ -6,6 +6,9 @@ import WtSwitcher from '../wt-switcher.vue';
6
6
  describe('WtSwitcher', () => {
7
7
  it('renders a component', () => {
8
8
  const wrapper = shallowMount(WtSwitcher, {
9
+ props: {
10
+ modelValue: false,
11
+ },
9
12
  stubs: {
10
13
  WtLabel,
11
14
  },
@@ -21,24 +24,19 @@ describe('WtSwitcher', () => {
21
24
  },
22
25
  props: {
23
26
  label,
27
+ modelValue: false,
24
28
  },
25
29
  });
26
30
  expect(wrapper.find('.wt-switcher__label').text()).toBe(label);
27
31
  });
28
32
 
29
- it('toggles passed value at click', () => {
30
- const value = true;
31
- const wrapper = mount(WtSwitcher, {
32
- stubs: {
33
- WtLabel,
34
- },
33
+ it('reflects left-label modifier class', () => {
34
+ const wrapper = shallowMount(WtSwitcher, {
35
35
  props: {
36
- value,
36
+ modelValue: false,
37
+ labelLeft: true,
37
38
  },
38
39
  });
39
- wrapper.find('.wt-switcher__input').trigger('change');
40
- expect(wrapper.emitted().change[0]).toEqual([
41
- !value,
42
- ]);
40
+ expect(wrapper.classes('wt-switcher--label-left')).toBe(true);
43
41
  });
44
42
  });
@@ -36,7 +36,7 @@ import type { ToggleSwitchProps } from 'primevue/toggleswitch';
36
36
  import { computed, nextTick, ref, useSlots } from 'vue';
37
37
 
38
38
  interface LabelProps {
39
- [key: string]: any;
39
+ [key: string]: unknown;
40
40
  }
41
41
 
42
42
  /**
@@ -299,7 +299,7 @@ interface Props extends DataTableProps {
299
299
 
300
300
  //lazy loading
301
301
  lazy?: boolean;
302
- onLoading?: (event: VirtualScrollerLazyEvent) => Promise<any>;
302
+ onLoading?: (event: VirtualScrollerLazyEvent) => Promise<unknown>;
303
303
  loading?: boolean;
304
304
  itemSize?: number | undefined;
305
305
  }
@@ -74,8 +74,7 @@ export default {
74
74
 
75
75
  moveActiveLine(newValue) {
76
76
  if (!this.current) return;
77
- if (!this.$refs || !this.$refs[newValue] || !this.$refs[newValue][0])
78
- return;
77
+ if (!this.$refs?.[newValue]?.[0]) return;
79
78
  const element = this.$refs[newValue][0];
80
79
  this.activeLineWidth = element.clientWidth;
81
80
  this.activeLineOffset = element.offsetLeft;
@@ -35,7 +35,7 @@ describe('WtTextarea', () => {
35
35
  autoresize: true,
36
36
  },
37
37
  });
38
- wrapper.find('.wt-textarea__textarea').trigger('keypress', {
38
+ wrapper.find('.wt-textarea__textarea').trigger('keydown', {
39
39
  key: 'Enter',
40
40
  });
41
41
  expect(wrapper.emitted().enter).toBeTruthy();
@@ -47,7 +47,7 @@ describe('WtTextarea', () => {
47
47
  WtLabel,
48
48
  },
49
49
  });
50
- wrapper.find('.wt-textarea__textarea').trigger('keypress', {
50
+ wrapper.find('.wt-textarea__textarea').trigger('keydown', {
51
51
  key: 'Enter',
52
52
  });
53
53
  expect(wrapper.emitted().enter).toBeFalsy();