@zohodesk/dot 1.0.0-temp-216 → 1.0.0-temp-218

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 (36) hide show
  1. package/README.md +5 -0
  2. package/es/AudioPlayer/__tests__/AudioPlayer.spec.js +186 -38
  3. package/es/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1851 -1
  4. package/es/list/SecondaryText/AccountName.js +12 -2
  5. package/es/list/SecondaryText/ContactName.js +12 -2
  6. package/es/list/SecondaryText/DepartmentText.js +12 -2
  7. package/es/list/SecondaryText/Email.js +13 -3
  8. package/es/list/SecondaryText/PhoneNumber.js +13 -3
  9. package/es/list/SecondaryText/PriorityText.js +12 -2
  10. package/es/list/SecondaryText/SecondaryText.js +12 -2
  11. package/es/list/SecondaryText/StatusText.js +12 -2
  12. package/es/list/SecondaryText/TicketId.js +13 -2
  13. package/es/list/SecondaryText/Website.js +13 -3
  14. package/es/list/SecondaryText/props/defaultProps.js +18 -0
  15. package/es/list/SecondaryText/props/propTypes.js +20 -0
  16. package/es/list/Subject/Subject.js +13 -3
  17. package/es/list/Subject/props/defaultProps.js +3 -1
  18. package/es/list/Subject/props/propTypes.js +28 -1
  19. package/lib/AudioPlayer/__tests__/AudioPlayer.spec.js +192 -32
  20. package/lib/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1851 -1
  21. package/lib/list/SecondaryText/AccountName.js +20 -2
  22. package/lib/list/SecondaryText/ContactName.js +20 -2
  23. package/lib/list/SecondaryText/DepartmentText.js +20 -2
  24. package/lib/list/SecondaryText/Email.js +21 -3
  25. package/lib/list/SecondaryText/PhoneNumber.js +21 -3
  26. package/lib/list/SecondaryText/PriorityText.js +20 -2
  27. package/lib/list/SecondaryText/SecondaryText.js +20 -2
  28. package/lib/list/SecondaryText/StatusText.js +20 -2
  29. package/lib/list/SecondaryText/TicketId.js +18 -2
  30. package/lib/list/SecondaryText/Website.js +21 -3
  31. package/lib/list/SecondaryText/props/defaultProps.js +18 -0
  32. package/lib/list/SecondaryText/props/propTypes.js +20 -0
  33. package/lib/list/Subject/Subject.js +21 -3
  34. package/lib/list/Subject/props/defaultProps.js +3 -1
  35. package/lib/list/Subject/props/propTypes.js +33 -1
  36. package/package.json +6 -12
package/README.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  In this Library, we Provide Some Basic Components to Build Your Application
4
4
 
5
+ # 1.7.25
6
+
7
+ - Added rtl:as:property comment for linear-gradient usages to ensure support in PostCSS
8
+
9
+
5
10
  # 1.7.24
6
11
 
7
12
  - **Timer**
@@ -1,44 +1,192 @@
1
1
  import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import AudioPlayer from "../AudioPlayer"; // import TestUtils from 'react-dom/test-utils';
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: "https://ypvnxx00-a.akamaihd.net/downloads/ringtones/files/mp3/yuvanringtone-44640.mp3"
8
+ src: 'https://ypvnxx00-a.akamaihd.net/downloads/ringtones/files/mp3/yuvanringtone-44640.mp3'
12
9
  };
13
- describe('AudioPlayer Test Cases', () => {
14
- // const { props,renderedDOM } = setup(
15
- // AudioPlayer,Object.assign({},defaultProps));
16
- test('rendering the defult props', () => {
17
- const {
18
- asFragment
19
- } = render( /*#__PURE__*/React.createElement(AudioPlayer, { ...defaultProps
20
- }));
21
- expect(asFragment()).toMatchSnapshot();
22
- }); // it('should render component', () => {
23
- // let component = TestUtils.scryRenderedComponentsWithTestid(
24
- // renderedDOM,
25
- // 'AudioPlayer');
26
- // expect(component.length).toBe(1);
27
- // })
28
- // it('should close player onclicking close',()=>{
29
- // let component = TestUtils.scryRenderedComponentsWithTestid(
30
- // renderedDOM,
31
- // 'audioPlayerClose'
32
- // )[0];
33
- // TestUtils.Simulate.click(component);
34
- // expect(props.togglePlayer).toHaveBeenCalled();
35
- // })
36
- // it('should download audio onclicking download',()=>{
37
- // let component = TestUtils.scryRenderedComponentsWithTestid(
38
- // renderedDOM,
39
- // 'audioDownload'
40
- // )[0];
41
- // TestUtils.Simulate.click(component);
42
- // expect(props.downloadFile).toHaveBeenCalled();
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
  });