@innovaccer/design-system 2.5.0-2 → 2.5.1

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 (123) hide show
  1. package/.all-contributorsrc +170 -0
  2. package/.github/workflows/jira.yml +1 -2
  3. package/.github/workflows/main.yml +1 -6
  4. package/.github/workflows/test.yml +22 -0
  5. package/CHANGELOG.md +21 -54
  6. package/CONTRIBUTING.md +23 -0
  7. package/README.md +124 -75
  8. package/core/components/atoms/button/Button.tsx +56 -55
  9. package/core/components/atoms/button/__tests__/Button.test.tsx +3 -12
  10. package/core/components/atoms/checkbox/Checkbox.tsx +3 -6
  11. package/core/components/atoms/collapsible/__stories__/index.story.tsx +2 -2
  12. package/core/components/atoms/dropdown/DropdownList.tsx +1 -1
  13. package/core/components/atoms/dropdown/__stories__/Options.tsx +15 -0
  14. package/core/components/atoms/dropdown/__tests__/Dropdown.test.tsx +202 -1
  15. package/core/components/atoms/dropdown/__tests__/Option.test.tsx +3 -0
  16. package/core/components/atoms/message/__stories__/CustomDescription.tsx +25 -0
  17. package/core/components/atoms/metaList/Meta.tsx +3 -1
  18. package/core/components/atoms/metaList/__tests__/MetaList.test.tsx +30 -36
  19. package/core/components/atoms/metricInput/MetricInput.tsx +2 -2
  20. package/core/components/atoms/outsideClick/__stories__/index.story.tsx +1 -1
  21. package/core/components/atoms/radio/Radio.tsx +7 -10
  22. package/core/components/atoms/radio/__tests__/Radio.test.tsx +13 -7
  23. package/core/components/css-utilities/Align/Align.story.tsx +1 -1
  24. package/core/components/css-utilities/Background/Background.story.tsx +1 -1
  25. package/core/components/css-utilities/Border/Border.story.tsx +128 -0
  26. package/core/components/css-utilities/Display/Display.story.tsx +1 -1
  27. package/core/components/css-utilities/Flex/Flex.story.tsx +1 -1
  28. package/core/components/css-utilities/Miscellaneous/Miscellaneous.story.tsx +1 -1
  29. package/core/components/css-utilities/Overflow/Overflow.story.tsx +1 -1
  30. package/core/components/css-utilities/Position/Position.story.tsx +1 -1
  31. package/core/components/css-utilities/Sizing/Sizing.story.tsx +1 -1
  32. package/core/components/css-utilities/Spacing/Spacing.story.tsx +1 -1
  33. package/core/components/molecules/chatMessage/__tests__/ChatMessage.test.tsx +20 -46
  34. package/core/components/molecules/dropzone/__tests__/Dropzone.test.tsx +47 -111
  35. package/core/components/molecules/dropzone/__tests__/Utilities.test.tsx +13 -13
  36. package/core/components/molecules/editableChipInput/EditableChipInput.tsx +3 -1
  37. package/core/components/molecules/editableInput/EditableInput.tsx +5 -3
  38. package/core/components/molecules/editableInput/__stories__/variants/Uncontrolled.story.tsx +1 -1
  39. package/core/components/molecules/editableInput/__tests__/EditableInput.test.tsx +1 -3
  40. package/core/components/molecules/emptyState/_tests_/EmptyState.test.tsx +3 -7
  41. package/core/components/molecules/fileUploader/FileUploaderItem.tsx +13 -2
  42. package/core/components/molecules/fileUploader/__stories__/index.story.tsx +156 -21
  43. package/core/components/molecules/fileUploader/__tests__/FileUploader.test.tsx +21 -80
  44. package/core/components/molecules/fileUploader/__tests__/FileUploaderList.test.tsx +9 -40
  45. package/core/components/molecules/fullscreenModal/FullscreenModal.tsx +7 -13
  46. package/core/components/molecules/fullscreenModal/__stories__/Layering.story.tsx +2 -2
  47. package/core/components/molecules/modal/Modal.tsx +18 -17
  48. package/core/components/molecules/modal/ModalBody.tsx +1 -1
  49. package/core/components/molecules/modal/__stories__/Layering.story.tsx +1 -1
  50. package/core/components/molecules/modal/__stories__/NoFooter.story.tsx +0 -1
  51. package/core/components/molecules/modal/__stories__/Scrolling.story.tsx +20 -38
  52. package/core/components/molecules/modal/__tests__/Modal.test.tsx +1 -1
  53. package/core/components/molecules/sidesheet/Sidesheet.tsx +16 -17
  54. package/core/components/organisms/choiceList/ChoiceList.tsx +212 -0
  55. package/core/components/organisms/choiceList/__stories__/Alignment.story.tsx +32 -0
  56. package/core/components/organisms/choiceList/__stories__/AllowMultiple.story.tsx +23 -0
  57. package/core/components/organisms/choiceList/__stories__/Controlled.story.tsx +34 -0
  58. package/core/components/organisms/choiceList/__stories__/index.story.tsx +18 -0
  59. package/core/components/organisms/choiceList/__tests__/ChoiceList.test.tsx +155 -0
  60. package/core/components/organisms/choiceList/__tests__/__snapshots__/ChoiceList.test.tsx.snap +3393 -0
  61. package/core/components/organisms/choiceList/index.tsx +2 -0
  62. package/core/components/organisms/datePicker/__tests__/DatePicker.test.tsx +136 -46
  63. package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +2594 -102
  64. package/core/components/organisms/dateRangePicker/DateRangePicker.tsx +5 -0
  65. package/core/components/organisms/dateRangePicker/__tests__/DateRangePicker.test.tsx +49 -410
  66. package/core/components/organisms/dateRangePicker/__tests__/Utilities.test.tsx +39 -0
  67. package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +45390 -2679
  68. package/core/components/organisms/dateRangePicker/utilities.tsx +2 -5
  69. package/core/components/organisms/grid/Cell.tsx +5 -4
  70. package/core/components/organisms/grid/Grid.tsx +1 -1
  71. package/core/components/organisms/grid/GridCell.tsx +18 -7
  72. package/core/components/organisms/grid/GridHead.tsx +1 -1
  73. package/core/components/organisms/grid/GridRow.tsx +5 -12
  74. package/core/components/organisms/grid/__tests__/Grid.test.tsx +179 -1
  75. package/core/components/organisms/grid/__tests__/GridCell.test.tsx +218 -0
  76. package/core/components/organisms/grid/__tests__/__snapshots__/Grid.test.tsx.snap +1024 -0
  77. package/core/components/organisms/grid/__tests__/rowUtility.test.tsx +62 -0
  78. package/core/components/organisms/inlineMessage/InlineMessage.tsx +10 -14
  79. package/core/components/organisms/inlineMessage/__stories__/InlineMessageWithinTable.story.tsx +9 -12
  80. package/core/components/organisms/inlineMessage/__stories__/variants/Default.story.tsx +2 -4
  81. package/core/components/organisms/inlineMessage/__stories__/variants/Error.story.tsx +2 -5
  82. package/core/components/organisms/inlineMessage/__stories__/variants/Info.story.tsx +2 -5
  83. package/core/components/organisms/inlineMessage/__stories__/variants/Success.story.tsx +2 -5
  84. package/core/components/organisms/inlineMessage/__stories__/variants/Warning.story.tsx +2 -5
  85. package/core/components/organisms/inlineMessage/__tests__/InlineMessage.test.tsx +4 -20
  86. package/core/components/organisms/navigation/VerticalNavigation.tsx +14 -3
  87. package/core/components/organisms/navigation/__tests__/Navigation.test.tsx +179 -0
  88. package/core/components/organisms/navigation/__tests__/__snapshots__/Navigation.test.tsx.snap +530 -0
  89. package/core/components/organisms/table/DraggableDropdown.tsx +1 -0
  90. package/core/components/organisms/table/Header.tsx +11 -2
  91. package/core/components/organisms/table/Table.tsx +2 -2
  92. package/core/components/organisms/table/__stories__/NestedTableWithNestedCard.story.tsx +4 -1
  93. package/core/components/organisms/table/__stories__/variants/nestedRows.story.tsx +5 -2
  94. package/core/components/organisms/table/__tests__/Table.test.tsx +292 -0
  95. package/core/components/organisms/table/__tests__/__snapshots__/Table.test.tsx.snap +349041 -0
  96. package/core/components/organisms/timePicker/__tests__/TimePicker.test.tsx +15 -66
  97. package/core/components/patterns/dateRangePicker/withCustomPopover.story.tsx +47 -36
  98. package/core/index.tsx +1 -1
  99. package/core/index.type.tsx +1 -0
  100. package/core/utils/OverlayManager.tsx +1 -3
  101. package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +4 -0
  102. package/core/utils/types.tsx +3 -4
  103. package/css/dist/index.css +78 -8
  104. package/css/dist/index.css.map +1 -1
  105. package/css/src/components/button.css +8 -4
  106. package/css/src/components/choiceList.css +25 -0
  107. package/css/src/components/modal.css +1 -2
  108. package/css/src/utils/border.css +39 -0
  109. package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +50 -49
  110. package/dist/core/components/css-utilities/Border/Border.story.d.ts +13 -0
  111. package/dist/core/components/organisms/choiceList/ChoiceList.d.ts +33 -0
  112. package/dist/core/components/organisms/choiceList/index.d.ts +2 -0
  113. package/dist/core/components/organisms/dateRangePicker/utilities.d.ts +2 -2
  114. package/dist/core/index.d.ts +1 -0
  115. package/dist/core/index.type.d.ts +1 -0
  116. package/dist/index.esm.js +207 -58
  117. package/dist/index.js +209 -57
  118. package/dist/index.js.map +1 -1
  119. package/dist/index.umd.js +1 -1
  120. package/dist/index.umd.js.br +0 -0
  121. package/dist/index.umd.js.gz +0 -0
  122. package/jest.config.js +2 -1
  123. package/package.json +6 -4
@@ -35,7 +35,7 @@ const customCode = `() => {
35
35
  }`;
36
36
 
37
37
  export default {
38
- title: 'Components/OutsideClick/All',
38
+ title: 'Others/Utilities/OutsideClick/All',
39
39
  component: OutsideClick,
40
40
  parameters: {
41
41
  docs: {
@@ -65,12 +65,9 @@ export const Radio = React.forwardRef<HTMLInputElement, RadioProps>((props, forw
65
65
 
66
66
  const ref = React.useRef<HTMLInputElement>(null);
67
67
 
68
- React.useImperativeHandle(
69
- forwardedRef,
70
- (): HTMLInputElement => {
71
- return ref.current as HTMLInputElement;
72
- }
73
- );
68
+ React.useImperativeHandle(forwardedRef, (): HTMLInputElement => {
69
+ return ref.current as HTMLInputElement;
70
+ });
74
71
 
75
72
  const RadioClass = classNames(
76
73
  {
@@ -123,10 +120,10 @@ export const Radio = React.forwardRef<HTMLInputElement, RadioProps>((props, forw
123
120
  </label>
124
121
  )}
125
122
  {helpText && (
126
- <Text data-test="DesignSystem-Radio-HelpText" size="small" appearance={disabled ? 'disabled' : 'subtle'}>
127
- {helpText.trim()}
128
- </Text>
129
- )}
123
+ <Text data-test="DesignSystem-Radio-HelpText" size="small" appearance={disabled ? 'disabled' : 'subtle'}>
124
+ {helpText.trim()}
125
+ </Text>
126
+ )}
130
127
  </div>
131
128
  </div>
132
129
  );
@@ -57,27 +57,29 @@ describe('Radio component', () => {
57
57
 
58
58
  describe('Radio component', () => {
59
59
  it('renders children', () => {
60
- const { getByTestId } = render(<Radio label={label} name={StringValue} value={StringValue}/>);
60
+ const { getByTestId } = render(<Radio label={label} name={StringValue} value={StringValue} />);
61
61
  expect(getByTestId('DesignSystem-Radio')).toBeInTheDocument();
62
62
  expect(getByTestId('DesignSystem-Radio-OuterWrapper')).toBeInTheDocument();
63
63
  });
64
64
 
65
65
  it('renders children : input', () => {
66
- const { getByTestId } = render(<Radio label={label} name={StringValue} value={StringValue}/>);
66
+ const { getByTestId } = render(<Radio label={label} name={StringValue} value={StringValue} />);
67
67
  expect(getByTestId('DesignSystem-Radio')).toBeInTheDocument();
68
68
  expect(getByTestId('DesignSystem-Radio-OuterWrapper')).toBeInTheDocument();
69
69
  expect(getByTestId('DesignSystem-Radio-Input')).toBeInTheDocument();
70
70
  });
71
71
 
72
72
  it('renders children with label prop', () => {
73
- const { getByTestId } = render(<Radio label={label} name={StringValue} value={StringValue}/>);
73
+ const { getByTestId } = render(<Radio label={label} name={StringValue} value={StringValue} />);
74
74
  expect(getByTestId('DesignSystem-Radio-Input')).toBeInTheDocument();
75
75
  expect(getByTestId('DesignSystem-Radio-Label')).toBeInTheDocument();
76
- expect(getByTestId('DesignSystem-Radio-Label').textContent).toMatch(label)
76
+ expect(getByTestId('DesignSystem-Radio-Label').textContent).toMatch(label);
77
77
  });
78
78
 
79
79
  it('renders children with helpText prop', () => {
80
- const { getByTestId } = render(<Radio label={label} name={StringValue} value={StringValue} helpText={StringValue} />);
80
+ const { getByTestId } = render(
81
+ <Radio label={label} name={StringValue} value={StringValue} helpText={StringValue} />
82
+ );
81
83
  expect(getByTestId('DesignSystem-Radio-Input')).toBeInTheDocument();
82
84
  expect(getByTestId('DesignSystem-Radio-Label')).toBeInTheDocument();
83
85
  expect(getByTestId('DesignSystem-Radio-HelpText')).toBeInTheDocument();
@@ -85,14 +87,18 @@ describe('Radio component', () => {
85
87
  });
86
88
 
87
89
  it('calls onchange handler', () => {
88
- const { getByTestId } = render(<Radio onChange={FunctionValue} label={label} name={StringValue} value={StringValue} helpText={StringValue} />);
90
+ const { getByTestId } = render(
91
+ <Radio onChange={FunctionValue} label={label} name={StringValue} value={StringValue} helpText={StringValue} />
92
+ );
89
93
  const input = getByTestId('DesignSystem-Radio-Input');
90
94
  fireEvent.click(input);
91
95
  expect(FunctionValue).toHaveBeenCalled();
92
96
  });
93
97
 
94
98
  it('calls onchange handler when box is checked ', () => {
95
- const { getByTestId } = render(<Radio onChange={FunctionValue} name={label} value={StringValue} label={StringValue} helpText={StringValue} />);
99
+ const { getByTestId } = render(
100
+ <Radio onChange={FunctionValue} name={label} value={StringValue} label={StringValue} helpText={StringValue} />
101
+ );
96
102
  const input = getByTestId('DesignSystem-Radio-Input');
97
103
  expect(input).not.toBeChecked();
98
104
  fireEvent.change(input, { target: { checked: true } });
@@ -86,7 +86,7 @@ export const align = () => {
86
86
  };
87
87
 
88
88
  export default {
89
- title: 'Others/Utilities/Align',
89
+ title: 'Others/Styles/Align',
90
90
  component: align,
91
91
  parameters: {
92
92
  viewMode: 'story',
@@ -111,7 +111,7 @@ export const background = () => {
111
111
  };
112
112
 
113
113
  export default {
114
- title: 'Others/Utilities/Background',
114
+ title: 'Others/Styles/Background',
115
115
  component: background,
116
116
  parameters: {
117
117
  viewMode: 'story',
@@ -0,0 +1,128 @@
1
+ import * as React from 'react';
2
+ import { Heading, Paragraph, Card, Table, Text } from '@/index';
3
+ import utilitiesSchema from '../Schema';
4
+
5
+ export const border = () => {
6
+ const data = [
7
+ {
8
+ className: 'border',
9
+ properties: 'border: var(--border) ;',
10
+ },
11
+ {
12
+ className: 'border-top',
13
+ properties: ' border-top: var(--border) ;',
14
+ },
15
+ {
16
+ className: 'border-bottom',
17
+ properties: 'border-bottom: var(--border) ;',
18
+ },
19
+ {
20
+ className: 'border-right',
21
+ properties: 'border-right: var(--border) ;',
22
+ },
23
+ {
24
+ className: 'border-left',
25
+ properties: 'border-left: var(--border) ;',
26
+ },
27
+ {
28
+ className: 'border-0',
29
+ properties: 'border: 0 ;',
30
+ },
31
+ {
32
+ className: 'border-top-0',
33
+ properties: ' border-top: 0 ;',
34
+ },
35
+ {
36
+ className: 'border-bottom-0',
37
+ properties: 'border-bottom: 0 ;',
38
+ },
39
+ {
40
+ className: 'border-right-0',
41
+ properties: 'border-right: 0 ;',
42
+ },
43
+ ];
44
+ return (
45
+ <div>
46
+ <Heading size="xxl">Border</Heading>
47
+ <br />
48
+ &nbsp;
49
+ <Text weight="strong">
50
+ Use border utilities to add or remove an element’s borders. Choose from all borders or one at a time.
51
+ </Text>
52
+ &nbsp;
53
+ <div
54
+ style={{
55
+ height: '250px',
56
+ }}
57
+ className="mt-5 mb-8"
58
+ >
59
+ <Card className="h-100">
60
+ <Table
61
+ data={data}
62
+ schema={utilitiesSchema}
63
+ size={'standard'}
64
+ headerOptions={{
65
+ withSearch: true,
66
+ }}
67
+ showMenu={false}
68
+ />
69
+ </Card>
70
+ </div>
71
+ <Heading size="m">Examples</Heading>
72
+ <Paragraph>Here are some representative examples of these classes:</Paragraph>
73
+ &nbsp;
74
+ <div className="pl-10 h-25 bg-light w-50">
75
+ <span className="border bg-secondary-lightest p-8 d-inline-block mr-6">border</span>
76
+ <span className="border-top bg-secondary-lightest p-8 d-inline-block mr-6">top</span>
77
+ <span className="border-right bg-secondary-lightest p-8 d-inline-block mr-6">right</span>
78
+ <span className="border-bottom bg-secondary-lightest p-8 d-inline-block mr-6">bottom</span>
79
+ <span className="border-left bg-secondary-lightest p-8 d-inline-block">left</span>
80
+ </div>
81
+ &nbsp;
82
+ <div className="DocPage-codeBlock w-50 pl-10">
83
+ {'<span className="border bg-secondary-lightest p-8 d-inline-block mr-6">border</span>'}
84
+ <br />
85
+ {'<span className="border-top bg-secondary-lightest p-8 d-inline-block mr-6">top</span>'}
86
+ <br />
87
+ {'<span className="border-right bg-secondary-lightest p-8 d-inline-block mr-6">right</span>'}
88
+ <br />
89
+ {'<span className="border-bottom bg-secondary-lightest p-8 d-inline-block mr-6">bottom</span>'}
90
+ <br />
91
+ {'<span className="border-left bg-secondary-lightest p-8 d-inline-block">left</span>'}
92
+ </div>
93
+ &nbsp;
94
+ <div className="pl-10 h-25 bg-light w-50">
95
+ <span className="border border-0 bg-secondary-lightest p-8 d-inline-block mr-6">border-0</span>
96
+ <span className="border border-top-0 bg-secondary-lightest p-8 d-inline-block mr-6">top-0</span>
97
+ <span className="border border-right-0 bg-secondary-lightest p-8 d-inline-block mr-6">right-0</span>
98
+ <span className="border border-bottom-0 bg-secondary-lightest p-8 d-inline-block mr-6">bottom-0</span>
99
+ <span className="border border-left-0 bg-secondary-lightest p-8 d-inline-block">left-0</span>
100
+ </div>
101
+ &nbsp;
102
+ <div className="DocPage-codeBlock w-50 pl-10">
103
+ {'<span className="border border-0 bg-secondary-lightest p-8 d-inline-block mr-6">border-0</span>'}
104
+ <br />
105
+ {'<span className="border border-top-0 bg-secondary-lightest p-8 d-inline-block mr-6">top-0</span>'}
106
+ <br />
107
+ {'<span className="border border-right-0 bg-secondary-lightest p-8 d-inline-block mr-6">right-0</span>'}
108
+ <br />
109
+ {'<span className="border border-bottom-0 bg-secondary-lightest p-8 d-inline-block mr-6">bottom-0</span>'}
110
+ <br />
111
+ {'<span className="border border-left-0 bg-secondary-lightest p-8 d-inline-block">left-0</span>'}
112
+ </div>
113
+ &nbsp;
114
+ </div>
115
+ );
116
+ };
117
+
118
+ export default {
119
+ title: 'Others/Styles/Border',
120
+ component: border,
121
+ parameters: {
122
+ viewMode: 'story',
123
+ docs: {
124
+ docPage: null,
125
+ page: null,
126
+ },
127
+ },
128
+ };
@@ -103,7 +103,7 @@ export const display = () => {
103
103
  };
104
104
 
105
105
  export default {
106
- title: 'Others/Utilities/Display',
106
+ title: 'Others/Styles/Display',
107
107
  component: display,
108
108
  parameters: {
109
109
  viewMode: 'story',
@@ -294,7 +294,7 @@ export const flex = () => {
294
294
  };
295
295
 
296
296
  export default {
297
- title: 'Others/Utilities/Flex',
297
+ title: 'Others/Styles/Flex',
298
298
  component: flex,
299
299
  parameters: {
300
300
  viewMode: 'story',
@@ -43,7 +43,7 @@ export const miscellaneous = () => {
43
43
  };
44
44
 
45
45
  export default {
46
- title: 'Others/Utilities/Miscellaneous',
46
+ title: 'Others/Styles/Miscellaneous',
47
47
  component: miscellaneous,
48
48
  parameters: {
49
49
  viewMode: 'story',
@@ -74,7 +74,7 @@ export const overflow = () => {
74
74
  };
75
75
 
76
76
  export default {
77
- title: 'Others/Utilities/Overflow',
77
+ title: 'Others/Styles/Overflow',
78
78
  component: overflow,
79
79
  parameters: {
80
80
  viewMode: 'story',
@@ -66,7 +66,7 @@ export const position = () => {
66
66
  };
67
67
 
68
68
  export default {
69
- title: 'Others/Utilities/Position',
69
+ title: 'Others/Styles/Position',
70
70
  component: position,
71
71
  parameters: {
72
72
  viewMode: 'story',
@@ -150,7 +150,7 @@ export const sizing = () => {
150
150
  };
151
151
 
152
152
  export default {
153
- title: 'Others/Utilities/Sizing',
153
+ title: 'Others/Styles/Sizing',
154
154
  component: sizing,
155
155
  parameters: {
156
156
  viewMode: 'story',
@@ -105,7 +105,7 @@ export const spacing = () => {
105
105
  };
106
106
 
107
107
  export default {
108
- title: 'Others/Utilities/Spacing',
108
+ title: 'Others/Styles/Spacing',
109
109
  component: spacing,
110
110
  parameters: {
111
111
  viewMode: 'story',
@@ -12,24 +12,20 @@ const TextValues = {
12
12
  failedText: 'Failed Text',
13
13
  sendingText: 'Sending Text',
14
14
  typingText: 'Typing Text',
15
- msgText: 'Message Text'
15
+ msgText: 'Message Text',
16
16
  };
17
17
 
18
18
  describe('ChatMessage component prop:type snapshot', () => {
19
19
  const mapper: Record<string, any> = {
20
20
  type: valueHelper(type, { required: true, iterate: true }),
21
- text: valueHelper(TextValues.msgText, { required: true })
21
+ text: valueHelper(TextValues.msgText, { required: true }),
22
22
  };
23
23
 
24
24
  const testFunc = (props: Record<string, any>): void => {
25
25
  const attr = filterUndefined(props) as Props;
26
26
 
27
27
  it(testMessageHelper(attr), () => {
28
- const { asFragment } = render(
29
- <ChatMessage
30
- {...attr}
31
- />
32
- );
28
+ const { asFragment } = render(<ChatMessage {...attr} />);
33
29
  expect(asFragment()).toMatchSnapshot();
34
30
  });
35
31
  };
@@ -40,18 +36,14 @@ describe('ChatMessage component prop:type snapshot', () => {
40
36
  describe('ChatMessage component prop:isTyping snapshot', () => {
41
37
  const mapper: Record<string, any> = {
42
38
  isTyping: valueHelper(BooleanValue, { iterate: true, required: false }),
43
- typingText: valueHelper(TextValues.typingText, { required: true })
39
+ typingText: valueHelper(TextValues.typingText, { required: true }),
44
40
  };
45
41
 
46
42
  const testFunc = (props: Record<string, any>): void => {
47
43
  const attr = filterUndefined(props) as Props;
48
44
 
49
45
  it(testMessageHelper(attr), () => {
50
- const { asFragment } = render(
51
- <ChatMessage
52
- {...attr}
53
- />
54
- );
46
+ const { asFragment } = render(<ChatMessage {...attr} />);
55
47
  expect(asFragment()).toMatchSnapshot();
56
48
  });
57
49
  };
@@ -61,18 +53,14 @@ describe('ChatMessage component prop:isTyping snapshot', () => {
61
53
 
62
54
  describe('ChatMessage component prop:text snapshot', () => {
63
55
  const mapper: Record<string, any> = {
64
- text: valueHelper(TextValues.msgText, { required: true })
56
+ text: valueHelper(TextValues.msgText, { required: true }),
65
57
  };
66
58
 
67
59
  const testFunc = (props: Record<string, any>): void => {
68
60
  const attr = filterUndefined(props) as Props;
69
61
 
70
62
  it(testMessageHelper(attr), () => {
71
- const { asFragment } = render(
72
- <ChatMessage
73
- {...attr}
74
- />
75
- );
63
+ const { asFragment } = render(<ChatMessage {...attr} />);
76
64
  expect(asFragment()).toMatchSnapshot();
77
65
  });
78
66
  };
@@ -84,11 +72,7 @@ describe('ChatMessage component with different values of prop:type ', () => {
84
72
  type.forEach((value) => {
85
73
  it(`check for Message Box to have class Box--${value} if type is ${value}`, () => {
86
74
  const { getByTestId } = render(
87
- <ChatMessage
88
- text={TextValues.msgText}
89
- type={value}
90
- typingText={TextValues.typingText}
91
- />
75
+ <ChatMessage text={TextValues.msgText} type={value} typingText={TextValues.typingText} />
92
76
  );
93
77
  expect(getByTestId('DesignSystem-ChatMessage--Box')).toHaveClass(`Box--${value}`);
94
78
  });
@@ -98,12 +82,7 @@ describe('ChatMessage component with different values of prop:type ', () => {
98
82
  describe('ChatMessage component prop:isTyping', () => {
99
83
  it('check for properties when isTyping is true', () => {
100
84
  const { getByTestId } = render(
101
- <ChatMessage
102
- type="incoming"
103
- text={TextValues.msgText}
104
- isTyping={true}
105
- typingText={TextValues.typingText}
106
- />
85
+ <ChatMessage type="incoming" text={TextValues.msgText} isTyping={true} typingText={TextValues.typingText} />
107
86
  );
108
87
  expect(getByTestId('DesignSystem-Text').textContent).toMatch(TextValues.typingText);
109
88
  expect(getByTestId('DesignSystem-ChatMessage--Box')).toHaveClass('Box-incoming--withStatus');
@@ -112,12 +91,7 @@ describe('ChatMessage component prop:isTyping', () => {
112
91
 
113
92
  it('check for text Message when isTyping is false', () => {
114
93
  const { getByTestId } = render(
115
- <ChatMessage
116
- type="incoming"
117
- text={TextValues.msgText}
118
- isTyping={false}
119
- typingText={TextValues.typingText}
120
- />
94
+ <ChatMessage type="incoming" text={TextValues.msgText} isTyping={false} typingText={TextValues.typingText} />
121
95
  );
122
96
  expect(getByTestId('DesignSystem-Text').textContent).toMatch(TextValues.msgText);
123
97
  expect(getByTestId('DesignSystem-ChatMessage--Box')).not.toHaveClass('Box-incoming--withStatus');
@@ -148,7 +122,7 @@ describe('ChatMessage component prop:statusOptions with type:failed', () => {
148
122
  typingText={TextValues.typingText}
149
123
  statusOptions={{
150
124
  type: 'failed',
151
- failedText: TextValues.failedText
125
+ failedText: TextValues.failedText,
152
126
  }}
153
127
  />
154
128
  );
@@ -180,7 +154,7 @@ describe('ChatMessage component prop:statusOptions with type:sending', () => {
180
154
  typingText={TextValues.typingText}
181
155
  statusOptions={{
182
156
  type: 'sending',
183
- sendingText: TextValues.sendingText
157
+ sendingText: TextValues.sendingText,
184
158
  }}
185
159
  />
186
160
  );
@@ -194,7 +168,7 @@ describe('ChatMessage component prop:statusOptions with type:sending', () => {
194
168
  type="incoming"
195
169
  typingText={TextValues.typingText}
196
170
  statusOptions={{
197
- type: 'sending'
171
+ type: 'sending',
198
172
  }}
199
173
  />
200
174
  );
@@ -211,7 +185,7 @@ describe('ChatMessage component prop:statusOptions with type:sent', () => {
211
185
  typingText={TextValues.typingText}
212
186
  statusOptions={{
213
187
  type: 'sent',
214
- time: timeStr
188
+ time: timeStr,
215
189
  }}
216
190
  />
217
191
  );
@@ -227,7 +201,7 @@ describe('ChatMessage component prop:statusOptions with type:sent', () => {
227
201
  typingText={TextValues.typingText}
228
202
  statusOptions={{
229
203
  type: 'sent',
230
- time: timeNum
204
+ time: timeNum,
231
205
  }}
232
206
  />
233
207
  );
@@ -245,7 +219,7 @@ describe('ChatMessage component prop:statusOptions with type:read', () => {
245
219
  typingText={TextValues.typingText}
246
220
  statusOptions={{
247
221
  type: 'read',
248
- readText: TextValues.readText
222
+ readText: TextValues.readText,
249
223
  }}
250
224
  />
251
225
  );
@@ -259,7 +233,7 @@ describe('ChatMessage component prop:statusOptions with type:read', () => {
259
233
  type="incoming"
260
234
  typingText={TextValues.typingText}
261
235
  statusOptions={{
262
- type: 'read'
236
+ type: 'read',
263
237
  }}
264
238
  />
265
239
  );
@@ -275,7 +249,7 @@ describe('ChatMessage component prop:statusOptions with type:read', () => {
275
249
  statusOptions={{
276
250
  type: 'read',
277
251
  readText: TextValues.readText,
278
- time: timeStr
252
+ time: timeStr,
279
253
  }}
280
254
  />
281
255
  );
@@ -292,7 +266,7 @@ describe('ChatMessage component prop:statusOptions with type:urgent', () => {
292
266
  type="incoming"
293
267
  typingText={TextValues.typingText}
294
268
  statusOptions={{
295
- type: 'urgent'
269
+ type: 'urgent',
296
270
  }}
297
271
  />
298
272
  );
@@ -307,7 +281,7 @@ describe('ChatMessage component prop:statusOptions with type:urgent', () => {
307
281
  typingText={TextValues.typingText}
308
282
  statusOptions={{
309
283
  type: 'urgent',
310
- time: timeStr
284
+ time: timeStr,
311
285
  }}
312
286
  />
313
287
  );