@zohodesk/dot 1.7.24 → 1.7.26
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/README.md +10 -0
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +1 -1
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +1 -1
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +1 -1
- package/es/AudioPlayer/__tests__/AudioPlayer.spec.js +186 -38
- package/es/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1851 -1
- package/es/list/SecondaryText/PhoneNumber.js +2 -2
- package/es/list/SecondaryText/SecondaryText.module.css +5 -1
- package/es/list/SecondaryText/__tests__/__snapshots__/PhoneNumber.spec.js.snap +1 -1
- package/lib/AudioPlayer/__tests__/AudioPlayer.spec.js +192 -32
- package/lib/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1851 -1
- package/lib/list/SecondaryText/PhoneNumber.js +2 -2
- package/lib/list/SecondaryText/SecondaryText.module.css +5 -1
- package/lib/list/SecondaryText/__tests__/__snapshots__/PhoneNumber.spec.js.snap +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
In this Library, we Provide Some Basic Components to Build Your Application
|
|
4
4
|
|
|
5
|
+
# 1.7.26
|
|
6
|
+
|
|
7
|
+
- `list/SecondaryText/PhoneNumber.js`
|
|
8
|
+
- RTL unicode-bidi issue fixed
|
|
9
|
+
|
|
10
|
+
# 1.7.25
|
|
11
|
+
|
|
12
|
+
- Added rtl:as:property comment for linear-gradient usages to ensure support in PostCSS
|
|
13
|
+
|
|
14
|
+
|
|
5
15
|
# 1.7.24
|
|
6
16
|
|
|
7
17
|
- **Timer**
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
--zdt_gridstencils_default_border: hsla(218, 23.08%, calc(22.94% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
232
232
|
--zdt_gridstencils_after_bg: hsla(217, 23.23%, calc(19.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
233
233
|
--zdt_gridstencils_listbar_bg: hsla(217, 23.23%, calc(19.41% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
234
|
-
--zdt_gridstencils_listbar_gradient_bg: linear-gradient(to left, #383f55 0, #414961 20%, #414961 40%, #383f55 100%);
|
|
234
|
+
--zdt_gridstencils_listbar_gradient_bg /* rtl:as:background-image */: linear-gradient(to left, #383f55 0, #414961 20%, #414961 40%, #383f55 100%);
|
|
235
235
|
|
|
236
236
|
/* icons */
|
|
237
237
|
--zdt_icons_default: hsla(217, 13.73%, calc(70.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
--zdt_gridstencils_default_border: hsla(0, 0.00%, calc(94.51% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
232
232
|
--zdt_gridstencils_after_bg: hsla(0, 0.00%, calc(92.16% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
233
233
|
--zdt_gridstencils_listbar_bg: hsla(210, 12.50%, calc(96.86% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
234
|
-
--zdt_gridstencils_listbar_gradient_bg: linear-gradient(to left, var(--zd_smoke78) 0, #edeef1 20%, var(--zd_smoke78) 40%, var(--zd_smoke78) 100%);
|
|
234
|
+
--zdt_gridstencils_listbar_gradient_bg /* rtl:as:background-image */: linear-gradient(to left, var(--zd_smoke78) 0, #edeef1 20%, var(--zd_smoke78) 40%, var(--zd_smoke78) 100%);
|
|
235
235
|
|
|
236
236
|
/* icons */
|
|
237
237
|
--zdt_icons_default: hsla(220, 10.45%, calc(39.41% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
--zdt_gridstencils_default_border: hsla(0, 2.33%, calc(8.43% + var(--zdc_default_inverse_medium)), calc(1 + var(--zdc_alpha_low)));
|
|
232
232
|
--zdt_gridstencils_after_bg: hsla(0, 0.00%, calc(16.86% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
233
233
|
--zdt_gridstencils_listbar_bg: hsla(0, 0.00%, calc(16.86% + var(--zdc_default)), calc(1 + var(--zdc_alpha_high)));
|
|
234
|
-
--zdt_gridstencils_listbar_gradient_bg: linear-gradient(to left, #212121 0, #262626 20%, #262626 40%, #212121 100%);
|
|
234
|
+
--zdt_gridstencils_listbar_gradient_bg /* rtl:as:background-image */: linear-gradient(to left, #212121 0, #262626 20%, #262626 40%, #212121 100%);
|
|
235
235
|
|
|
236
236
|
/* icons */
|
|
237
237
|
--zdt_icons_default: hsla(0, 0.00%, calc(60.00% + var(--zdc_default_inverse)), calc(1 + var(--zdc_alpha_high)));
|
|
@@ -1,44 +1,192 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import AudioPlayer from "../AudioPlayer";
|
|
4
|
-
|
|
5
|
-
const defaultProps = {
|
|
6
|
-
togglePlayer: jest.fn(),
|
|
7
|
-
downloadFile: jest.fn(),
|
|
2
|
+
import { render, fireEvent, screen } from '@testing-library/react';
|
|
3
|
+
import AudioPlayer from "../AudioPlayer";
|
|
4
|
+
const DEFAULT_PROPS = {
|
|
8
5
|
minute: '02',
|
|
9
6
|
second: '03',
|
|
10
7
|
durationInSec: '203',
|
|
11
|
-
src:
|
|
8
|
+
src: 'https://ypvnxx00-a.akamaihd.net/downloads/ringtones/files/mp3/yuvanringtone-44640.mp3'
|
|
12
9
|
};
|
|
13
|
-
describe('AudioPlayer
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
10
|
+
describe('AudioPlayer - Snapshot', () => {
|
|
11
|
+
test('Render with default props', () => {
|
|
12
|
+
const {
|
|
13
|
+
asFragment
|
|
14
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS
|
|
15
|
+
}));
|
|
16
|
+
expect(asFragment()).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
test('Render with customId and testId', () => {
|
|
19
|
+
const {
|
|
20
|
+
asFragment
|
|
21
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
22
|
+
customId: "audio-player-customId",
|
|
23
|
+
testId: "audio-player-testId"
|
|
24
|
+
}));
|
|
25
|
+
expect(asFragment()).toMatchSnapshot();
|
|
26
|
+
});
|
|
27
|
+
test('Render with tag attributes', () => {
|
|
28
|
+
const {
|
|
29
|
+
asFragment
|
|
30
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
31
|
+
tagAttributes: {
|
|
32
|
+
'data-custom-attr': 'true'
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
expect(asFragment()).toMatchSnapshot();
|
|
36
|
+
});
|
|
37
|
+
test('Render with a11y attributes', () => {
|
|
38
|
+
const {
|
|
39
|
+
asFragment
|
|
40
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
41
|
+
a11yAttributes: {
|
|
42
|
+
role: 'region'
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
expect(asFragment()).toMatchSnapshot();
|
|
46
|
+
});
|
|
47
|
+
test('Render with customClass', () => {
|
|
48
|
+
const {
|
|
49
|
+
asFragment
|
|
50
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
51
|
+
customClass: "my-audio-player"
|
|
52
|
+
}));
|
|
53
|
+
expect(asFragment()).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
test('Render with i18nKeys', () => {
|
|
56
|
+
const {
|
|
57
|
+
asFragment
|
|
58
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
59
|
+
i18nKeys: {
|
|
60
|
+
play: 'Play',
|
|
61
|
+
pause: 'Pause'
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
expect(asFragment()).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
test('Render with needClose=false', () => {
|
|
67
|
+
const {
|
|
68
|
+
asFragment
|
|
69
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
70
|
+
needClose: false
|
|
71
|
+
}));
|
|
72
|
+
expect(asFragment()).toMatchSnapshot();
|
|
73
|
+
});
|
|
74
|
+
test('Render with needDownload=false', () => {
|
|
75
|
+
const {
|
|
76
|
+
asFragment
|
|
77
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
78
|
+
needDownload: false
|
|
79
|
+
}));
|
|
80
|
+
expect(asFragment()).toMatchSnapshot();
|
|
81
|
+
});
|
|
82
|
+
test('Render with needMuteIcon=true', () => {
|
|
83
|
+
const {
|
|
84
|
+
asFragment
|
|
85
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
86
|
+
needMuteIcon: true
|
|
87
|
+
}));
|
|
88
|
+
expect(asFragment()).toMatchSnapshot();
|
|
89
|
+
});
|
|
90
|
+
test('Render with isPlay=true', () => {
|
|
91
|
+
const {
|
|
92
|
+
asFragment
|
|
93
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
94
|
+
isPlay: true
|
|
95
|
+
}));
|
|
96
|
+
expect(asFragment()).toMatchSnapshot();
|
|
97
|
+
});
|
|
98
|
+
test('Render with timerFormat=ss:mm', () => {
|
|
99
|
+
const {
|
|
100
|
+
asFragment
|
|
101
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
102
|
+
timerFormat: "ss:mm"
|
|
103
|
+
}));
|
|
104
|
+
expect(asFragment()).toMatchSnapshot();
|
|
105
|
+
});
|
|
106
|
+
test('Render with forwardStepInSec=10', () => {
|
|
107
|
+
const {
|
|
108
|
+
asFragment
|
|
109
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
110
|
+
forwardStepInSec: 10
|
|
111
|
+
}));
|
|
112
|
+
expect(asFragment()).toMatchSnapshot();
|
|
113
|
+
});
|
|
114
|
+
test('Render with backwardStepInSec=10', () => {
|
|
115
|
+
const {
|
|
116
|
+
asFragment
|
|
117
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
118
|
+
backwardStepInSec: 10
|
|
119
|
+
}));
|
|
120
|
+
expect(asFragment()).toMatchSnapshot();
|
|
121
|
+
});
|
|
122
|
+
test('Render with range=50', () => {
|
|
123
|
+
const {
|
|
124
|
+
asFragment
|
|
125
|
+
} = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
126
|
+
range: 50
|
|
127
|
+
}));
|
|
128
|
+
expect(asFragment()).toMatchSnapshot();
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
describe('AudioPlayer - Unit', () => {
|
|
132
|
+
test('Should call togglePlayer on close button click', () => {
|
|
133
|
+
const togglePlayer = jest.fn();
|
|
134
|
+
render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
135
|
+
togglePlayer: togglePlayer
|
|
136
|
+
}));
|
|
137
|
+
const closeBtn = screen.queryByTestId('audioPlayerClose');
|
|
138
|
+
|
|
139
|
+
if (closeBtn) {
|
|
140
|
+
fireEvent.click(closeBtn);
|
|
141
|
+
expect(togglePlayer).toHaveBeenCalled();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
test('Should call downloadFile on download button click', () => {
|
|
145
|
+
const downloadFile = jest.fn();
|
|
146
|
+
render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
147
|
+
downloadFile: downloadFile
|
|
148
|
+
}));
|
|
149
|
+
const downloadBtn = screen.queryByTestId('audioDownload');
|
|
150
|
+
|
|
151
|
+
if (downloadBtn) {
|
|
152
|
+
fireEvent.click(downloadBtn);
|
|
153
|
+
expect(downloadFile).toHaveBeenCalled();
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
test('Should toggle play/pause on play button click', () => {
|
|
157
|
+
const togglePlayer = jest.fn();
|
|
158
|
+
render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
159
|
+
togglePlayer: togglePlayer
|
|
160
|
+
}));
|
|
161
|
+
const playBtn = screen.queryByTestId('audioPlayPause');
|
|
162
|
+
|
|
163
|
+
if (playBtn) {
|
|
164
|
+
fireEvent.click(playBtn);
|
|
165
|
+
expect(togglePlayer).toHaveBeenCalled();
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
test('Should mute/unmute on mute button click', () => {
|
|
169
|
+
render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
170
|
+
needMuteIcon: true
|
|
171
|
+
}));
|
|
172
|
+
const muteBtn = screen.queryByTestId('audioMute');
|
|
173
|
+
|
|
174
|
+
if (muteBtn) {
|
|
175
|
+
fireEvent.click(muteBtn); // Add assertion if mute state is exposed via prop or DOM
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
test('Should change range on slider input', () => {
|
|
179
|
+
render( /*#__PURE__*/React.createElement(AudioPlayer, { ...DEFAULT_PROPS,
|
|
180
|
+
range: 0
|
|
181
|
+
}));
|
|
182
|
+
const rangeInput = screen.queryByTestId('audioRange');
|
|
183
|
+
|
|
184
|
+
if (rangeInput) {
|
|
185
|
+
fireEvent.change(rangeInput, {
|
|
186
|
+
target: {
|
|
187
|
+
value: 50
|
|
188
|
+
}
|
|
189
|
+
}); // Add assertion if range change is exposed via prop or DOM
|
|
190
|
+
}
|
|
191
|
+
});
|
|
44
192
|
});
|