@webitel/ui-sdk 26.4.17 → 26.4.18

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 (95) hide show
  1. package/dist/displayText-Cbh4IOfM.js +5 -0
  2. package/dist/{index-B_bOPX3o.js → index-B0AYwz58.js} +1 -1
  3. package/dist/{index-eEFER0lI.js → index-Dvhbo446.js} +1 -1
  4. package/dist/{install-C_4PcYy4.js → install-CrJnxpPS.js} +1729 -1726
  5. package/dist/{isObject-Bc_zejYi.js → isObject-BsWrydYX.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-Bmp2wHly.js} +1 -1
  10. package/dist/{vidstack-Bq6c3Bam-Do_GZqV0.js → vidstack-Bq6c3Bam-N3JOOQyW.js} +3 -3
  11. package/dist/{vidstack-D2pY00kU-DtEQuJNJ.js → vidstack-D2pY00kU-ByaRFZub.js} +3 -3
  12. package/dist/{vidstack-DDXt6fpN-BjUme5OE.js → vidstack-DDXt6fpN-H7PZzMEr.js} +2 -2
  13. package/dist/{vidstack-D_-9AA6_-BUgV5EDC.js → vidstack-D_-9AA6_-BgRVFwPt.js} +2 -2
  14. package/dist/{vidstack-DqAw8m9J-D5-emHfz.js → vidstack-DqAw8m9J-BODJkoui.js} +1 -1
  15. package/dist/{vidstack-audio-DmysFuAQ.js → vidstack-audio-Cnpq73DL.js} +2 -2
  16. package/dist/{vidstack-dash-CF4d8BuX.js → vidstack-dash-Bzo3Gzfd.js} +4 -4
  17. package/dist/{vidstack-google-cast-CNPyXY9S.js → vidstack-google-cast--giiu8Z5.js} +4 -4
  18. package/dist/{vidstack-hls-BLaXkLiF.js → vidstack-hls-CrDFf1Gs.js} +4 -4
  19. package/dist/{vidstack-video-v_RKZWR5.js → vidstack-video-h7Tsw5LU.js} +3 -3
  20. package/dist/{vidstack-vimeo-BCNYIpmz.js → vidstack-vimeo-CbcdGN2R.js} +4 -4
  21. package/dist/{vidstack-youtube-C1DaWOJU.js → vidstack-youtube-DKzx3LPK.js} +3 -3
  22. package/dist/{wt-action-bar-Ckg4xWY1.js → wt-action-bar-GCDVmO0b.js} +1 -1
  23. package/dist/{wt-button-select-DHqtUP4R.js → wt-button-select-BBsJj7FV.js} +1 -1
  24. package/dist/{wt-chat-emoji-BVMxNx8W.js → wt-chat-emoji-MhnNs-SG.js} +2 -2
  25. package/dist/{wt-confirm-dialog-BNjF-amp.js → wt-confirm-dialog-B4J3ZU2r.js} +1 -1
  26. package/dist/{wt-context-menu-DkK9-qLI.js → wt-context-menu-Cekc6Rva.js} +1 -1
  27. package/dist/{wt-copy-action-7hL0mEvW.js → wt-copy-action-CT_0bHmt.js} +1 -1
  28. package/dist/{wt-datepicker-Bvde1_4k.js → wt-datepicker-B513Tw-Z.js} +1 -1
  29. package/dist/wt-display-chip-items-CMB33VOU.js +47 -0
  30. package/dist/{wt-dual-panel-C6E7X3c8.js → wt-dual-panel-DjHHFx8Y.js} +1 -1
  31. package/dist/{wt-dummy-oCvw9ZAO.js → wt-dummy-BivOEKRK.js} +1 -1
  32. package/dist/{wt-error-page-BWRGUdsV.js → wt-error-page-krwX0484.js} +1 -1
  33. package/dist/{wt-expansion-card-DqdyzBFB.js → wt-expansion-card-Mrne6YQJ.js} +1 -1
  34. package/dist/{wt-expansion-panel-CGYB7-8V.js → wt-expansion-panel-D0SABYA1.js} +1 -1
  35. package/dist/{wt-filters-panel-wrapper-BdWYuFBU.js → wt-filters-panel-wrapper-Dffe4cS8.js} +1 -1
  36. package/dist/{wt-galleria-BBSNSwsR.js → wt-galleria-CB3UNqGT.js} +1 -1
  37. package/dist/{wt-navigation-menu-CubDPnaE.js → wt-navigation-menu-CozB-VN3.js} +1 -1
  38. package/dist/{wt-notifications-bar-B9gUZbnG.js → wt-notifications-bar-CBv9RpW3.js} +2 -2
  39. package/dist/{wt-pagination-Dafsnmhz.js → wt-pagination-CrnHm3Ei.js} +1 -1
  40. package/dist/{wt-player-DxvKDEYJ.js → wt-player-Be7Ts4oe.js} +2 -2
  41. package/dist/wt-screen-recordings-action-VJpYH40a.js +55 -0
  42. package/dist/{wt-search-bar-BSTKSDBo.js → wt-search-bar-BNUpiOyg.js} +1 -1
  43. package/dist/{wt-selection-popup-D_mDRYjd.js → wt-selection-popup-DZG_s5cn.js} +1 -1
  44. package/dist/{wt-start-page-BYGMWDsS.js → wt-start-page-B1Ya211Z.js} +1 -1
  45. package/dist/{wt-status-select-BDFd1JE-.js → wt-status-select-ByEBtG_Z.js} +1 -1
  46. package/dist/{wt-stepper-Db5aEz47.js → wt-stepper-Bke8hGIN.js} +1 -1
  47. package/dist/{wt-table-actions-BTmBjf1Q.js → wt-table-actions-D2QF78Jq.js} +1 -1
  48. package/dist/{wt-table-column-select-abILUxUr.js → wt-table-column-select-BtcIByjb.js} +2 -2
  49. package/dist/{wt-table-92BKexHp.js → wt-table-rT0puxyU.js} +1 -1
  50. package/dist/{wt-tabs-B21sWbPs.js → wt-tabs-BIn8m45h.js} +1 -1
  51. package/dist/{wt-tags-input-DNA22dSR.js → wt-tags-input-Bz3T5KC7.js} +2 -2
  52. package/dist/{wt-timepicker-CgowHF74.js → wt-timepicker-CuMYCWnA.js} +1 -1
  53. package/dist/{wt-tree-CvHw827i.js → wt-tree-DftQx0vm.js} +2 -2
  54. package/dist/{wt-tree-table-DWgEjAUG.js → wt-tree-table-Cqt8iSLj.js} +1 -1
  55. package/dist/{wt-type-extension-value-input-BvHowj58.js → wt-type-extension-value-input-rX_qRFjQ.js} +2 -2
  56. package/dist/{wt-vidstack-player-BnK8NLH3.js → wt-vidstack-player-CWmoXIAG.js} +10 -10
  57. package/package.json +5 -2
  58. package/src/api/clients/users/__tests__/users.spec.js +1 -1
  59. package/src/components/index.js +8 -0
  60. package/src/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue +72 -0
  61. package/src/components/wt-button/__tests__/WtButton.spec.js +10 -5
  62. package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +13 -16
  63. package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +6 -2
  64. package/src/components/wt-chip/__tests__/WtChip.spec.js +3 -3
  65. package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +4 -17
  66. package/src/components/wt-icon/__tests__/WtIcon.spec.js +19 -2
  67. package/src/components/wt-pagination/__tests__/WtPagination.spec.js +80 -16
  68. package/src/components/wt-radio/__tests__/WtRadio.spec.js +8 -2
  69. package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +98 -0
  70. package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +9 -11
  71. package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +2 -2
  72. package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +18 -1
  73. package/src/components/wt-timepicker/__tests__/WtTimepicker.spec.js +9 -15
  74. package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +60 -80
  75. package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +6 -47
  76. package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +31 -3
  77. package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +16 -10
  78. package/src/modules/AuditForm/components/form-questions/options/__tests__/audit-form-question-options.spec.js +4 -6
  79. package/src/modules/AuditForm/components/form-questions/score/__tests__/audit-form-question-score.spec.js +2 -2
  80. package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +7 -51
  81. package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +12 -8
  82. package/types/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue.d.ts +10 -0
  83. package/dist/wt-display-chip-items-DPoEtUZ-.js +0 -46
  84. package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +0 -15
  85. package/src/components/wt-divider/__tests__/WtDivider.spec.js +0 -10
  86. package/src/components/wt-slider/__tests__/WtSlider.spec.js +0 -10
  87. package/src/components/wt-table/__tests__/WtTable.spec.js +0 -140
  88. package/src/modules/Filters/components/__tests__/filter-pagination.spec.js +0 -109
  89. package/src/modules/Filters/components/__tests__/filter-table-fields.spec.js +0 -112
  90. package/types/components/wt-copy-action/__tests__/WtCopyAction.spec.d.ts +0 -1
  91. package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +0 -1
  92. package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +0 -1
  93. package/types/components/wt-table/__tests__/WtTable.spec.d.ts +0 -1
  94. package/types/modules/Filters/components/__tests__/filter-pagination.spec.d.ts +0 -1
  95. package/types/modules/Filters/components/__tests__/filter-table-fields.spec.d.ts +0 -1
@@ -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
  });
@@ -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
  });
@@ -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
  });
@@ -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
  });
@@ -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
  });
@@ -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();
@@ -10,7 +10,7 @@ describe('WtTimeInput', () => {
10
10
  WtLabel,
11
11
  },
12
12
  });
13
- expect(wrapper.classes('wt-time-input')).toBe(true);
13
+ expect(wrapper.exists()).toBe(true);
14
14
  });
15
15
 
16
16
  it('renders label text when passed', () => {
@@ -25,4 +25,21 @@ describe('WtTimeInput', () => {
25
25
  });
26
26
  expect(wrapper.find('.wt-label').text()).toBe(label);
27
27
  });
28
+
29
+ it('emits model update from input-number', () => {
30
+ const wrapper = shallowMount(WtTimeInput, {
31
+ props: {
32
+ modelValue: 0,
33
+ },
34
+ });
35
+
36
+ wrapper
37
+ .findComponent({
38
+ name: 'wt-input-number',
39
+ })
40
+ .vm.$emit('update:modelValue', 7);
41
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
42
+ 7,
43
+ ]);
44
+ });
28
45
  });
@@ -26,49 +26,43 @@ describe('WtTimepicker', () => {
26
26
  });
27
27
 
28
28
  it('Correctly converts value from MIN time-input to output', async () => {
29
- const value = 0;
30
29
  const wrapper = mount(WtTimepicker, {
31
- // stubs: {
32
- // WtTimeInput,
33
- // },
34
30
  props: {
35
- value,
31
+ modelValue: 0,
36
32
  },
37
33
  });
38
- wrapper.findAllComponents(WtTimeInput).at(0).vm.$emit('input', 21);
39
- expect(wrapper.emitted().input[0]).toEqual([
34
+ wrapper.findAllComponents(WtTimeInput)[0].vm.$emit('update:modelValue', 21);
35
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
40
36
  21 * 60 * 60,
41
37
  ]);
42
38
  });
43
39
 
44
40
  it('Correctly converts value from HOUR time-input to output', () => {
45
- const value = 0;
46
41
  const wrapper = mount(WtTimepicker, {
47
42
  stubs: {
48
43
  WtTimeInput,
49
44
  },
50
45
  props: {
51
- value,
46
+ modelValue: 0,
52
47
  },
53
48
  });
54
- wrapper.findAllComponents(WtTimeInput).at(1).vm.$emit('input', 21);
55
- expect(wrapper.emitted().input[0]).toEqual([
49
+ wrapper.findAllComponents(WtTimeInput)[1].vm.$emit('update:modelValue', 21);
50
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
56
51
  21 * 60,
57
52
  ]);
58
53
  });
59
54
 
60
55
  it('Correctly converts value from SEC time-input to output', () => {
61
- const value = 0;
62
56
  const wrapper = mount(WtTimepicker, {
63
57
  stubs: {
64
58
  WtTimeInput,
65
59
  },
66
60
  props: {
67
- value,
61
+ modelValue: 0,
68
62
  },
69
63
  });
70
- wrapper.findAllComponents(WtTimeInput).at(2).vm.$emit('input', 21);
71
- expect(wrapper.emitted().input[0]).toEqual([
64
+ wrapper.findAllComponents(WtTimeInput)[2].vm.$emit('update:modelValue', 21);
65
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
72
66
  21,
73
67
  ]);
74
68
  });
@@ -2,137 +2,117 @@ import { useRepresentableAgentPauseCause } from '../useRepresentableAgentPauseCa
2
2
 
3
3
  describe('useRepresentableAgentPauseCause', () => {
4
4
  it('correctly computes duration', () => {
5
- const pauseCauses = {
6
- value: [
7
- {
8
- durationMin: 10,
9
- limitMin: 12,
10
- },
11
- ],
12
- };
5
+ const pauseCauses = [
6
+ {
7
+ durationMin: 10,
8
+ limitMin: 12,
9
+ },
10
+ ];
13
11
  const { representablePauseCause } =
14
12
  useRepresentableAgentPauseCause(pauseCauses);
15
13
  expect(representablePauseCause.value[0].duration).toBe('00:10');
16
14
  });
17
15
  it('isOverflow with limit = 0 returns false', () => {
18
- const pauseCauses = {
19
- value: [
20
- {
21
- durationMin: 10,
22
- limitMin: 0,
23
- },
24
- ],
25
- };
16
+ const pauseCauses = [
17
+ {
18
+ durationMin: 10,
19
+ limitMin: 0,
20
+ },
21
+ ];
26
22
  const { representablePauseCause } =
27
23
  useRepresentableAgentPauseCause(pauseCauses);
28
24
  expect(representablePauseCause.value[0].isOverflow).toBe(false);
29
25
  });
30
26
  it('isOverflow with duration < limit returns false', () => {
31
- const pauseCauses = {
32
- value: [
33
- {
34
- durationMin: 10,
35
- limitMin: 12,
36
- },
37
- ],
38
- };
27
+ const pauseCauses = [
28
+ {
29
+ durationMin: 10,
30
+ limitMin: 12,
31
+ },
32
+ ];
39
33
  const { representablePauseCause } =
40
34
  useRepresentableAgentPauseCause(pauseCauses);
41
35
  expect(representablePauseCause.value[0].isOverflow).toBe(false);
42
36
  });
43
37
  it('isOverflow with duration > limit returns true', () => {
44
- const pauseCauses = {
45
- value: [
46
- {
47
- durationMin: 14,
48
- limitMin: 12,
49
- },
50
- ],
51
- };
38
+ const pauseCauses = [
39
+ {
40
+ durationMin: 14,
41
+ limitMin: 12,
42
+ },
43
+ ];
52
44
  const { representablePauseCause } =
53
45
  useRepresentableAgentPauseCause(pauseCauses);
54
46
  expect(representablePauseCause.value[0].isOverflow).toBe(true);
55
47
  });
56
48
 
57
49
  it('isOverflow with duration = limit returns false', () => {
58
- const pauseCauses = {
59
- value: [
60
- {
61
- durationMin: 12,
62
- limitMin: 12,
63
- },
64
- ],
65
- };
50
+ const pauseCauses = [
51
+ {
52
+ durationMin: 12,
53
+ limitMin: 12,
54
+ },
55
+ ];
66
56
  const { representablePauseCause } =
67
57
  useRepresentableAgentPauseCause(pauseCauses);
68
58
  expect(representablePauseCause.value[0].isOverflow).toBe(false);
69
59
  });
70
60
 
71
61
  it('correctly computes progressColor', () => {
72
- const pauseCauses = {
73
- value: [
74
- {
75
- durationMin: 10,
76
- limitMin: 12,
77
- },
78
- ],
79
- };
62
+ const pauseCauses = [
63
+ {
64
+ durationMin: 10,
65
+ limitMin: 12,
66
+ },
67
+ ];
80
68
  const { representablePauseCause } =
81
69
  useRepresentableAgentPauseCause(pauseCauses);
82
70
  expect(representablePauseCause.value[0].progressColor).toBe('primary');
83
71
  });
84
72
 
85
73
  it('correctly computes progressColor with duration > limit', () => {
86
- const pauseCauses = {
87
- value: [
88
- {
89
- durationMin: 14,
90
- limitMin: 12,
91
- },
92
- ],
93
- };
74
+ const pauseCauses = [
75
+ {
76
+ durationMin: 14,
77
+ limitMin: 12,
78
+ },
79
+ ];
94
80
  const { representablePauseCause } =
95
81
  useRepresentableAgentPauseCause(pauseCauses);
96
82
  expect(representablePauseCause.value[0].progressColor).toBe('error');
97
83
  });
98
84
 
99
85
  it('correctly computes progressColor with duration < limit', () => {
100
- const pauseCauses = {
101
- value: [
102
- {
103
- durationMin: 3,
104
- limitMin: 12,
105
- },
106
- ],
107
- };
86
+ const pauseCauses = [
87
+ {
88
+ durationMin: 3,
89
+ limitMin: 12,
90
+ },
91
+ ];
108
92
  const { representablePauseCause } =
109
93
  useRepresentableAgentPauseCause(pauseCauses);
110
94
  expect(representablePauseCause.value[0].progressColor).toBe('success');
111
95
  });
112
96
 
113
97
  it('correctly computes progressColor with duration = limit', () => {
114
- const pauseCauses = {
115
- value: [
116
- {
117
- durationMin: 12,
118
- limitMin: 12,
119
- },
120
- ],
121
- };
98
+ const pauseCauses = [
99
+ {
100
+ durationMin: 12,
101
+ limitMin: 12,
102
+ },
103
+ ];
122
104
  const { representablePauseCause } =
123
105
  useRepresentableAgentPauseCause(pauseCauses);
124
106
  expect(representablePauseCause.value[0].progressColor).toBe('primary');
125
107
  });
126
108
 
127
109
  it('correctly computes limit', () => {
128
- const pauseCauses = {
129
- value: [
130
- {
131
- durationMin: 12,
132
- limitMin: 12,
133
- },
134
- ],
135
- };
110
+ const pauseCauses = [
111
+ {
112
+ durationMin: 12,
113
+ limitMin: 12,
114
+ },
115
+ ];
136
116
  const { representablePauseCause } =
137
117
  useRepresentableAgentPauseCause(pauseCauses);
138
118
  expect(representablePauseCause.value[0].limit).toBe('00:12');