@tactics/toddle-styleguide 5.2.2 → 5.3.3

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 (186) hide show
  1. package/App.tsx +11 -19
  2. package/app.json +8 -4
  3. package/index.tsx +2 -4
  4. package/package.json +55 -27
  5. package/src/components/atoms/calendar/calendar.component.tsx +10 -6
  6. package/src/components/atoms/calendar/calendar.preview.tsx +4 -3
  7. package/src/components/molecules/amount/amount.component.tsx +5 -4
  8. package/src/components/molecules/calendar-select/calendar-select.component.d.ts +4 -4
  9. package/src/components/molecules/calendar-select/calendar-select.component.tsx +17 -16
  10. package/src/components/molecules/calendar-select/calendar-select.preview.tsx +16 -5
  11. package/src/components/molecules/contact-address/contact-address.component.d.ts +8 -0
  12. package/src/components/molecules/contact-address/contact-address.component.tsx +20 -0
  13. package/src/components/molecules/contact-address/contact-address.preview.d.ts +2 -0
  14. package/src/components/molecules/contact-address/contact-address.preview.tsx +17 -0
  15. package/src/components/molecules/contact-address/contact-address.styles.d.ts +7 -0
  16. package/src/components/molecules/contact-address/contact-address.styles.js +10 -0
  17. package/src/components/molecules/date-input/date-input.component.d.ts +2 -2
  18. package/src/components/molecules/date-input/date-input.component.tsx +3 -3
  19. package/src/components/molecules/date-input/date-input.preview.tsx +5 -5
  20. package/src/components/molecules/day/day.component.d.ts +3 -3
  21. package/src/components/molecules/day/day.component.tsx +22 -17
  22. package/src/components/molecules/selectable-list-item/selectable-list-item.component.tsx +12 -7
  23. package/src/components/molecules/timestamp/timestamp.component.d.ts +2 -2
  24. package/src/components/molecules/timestamp/timestamp.component.tsx +12 -5
  25. package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.d.ts +2 -2
  26. package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.tsx +5 -5
  27. package/src/components/organisms/journal-entry/journal-entry.component.d.ts +3 -3
  28. package/src/components/organisms/journal-entry/journal-entry.component.tsx +7 -3
  29. package/src/components/organisms/journal-entry/journal-entry.preview.tsx +7 -3
  30. package/src/components/organisms/person-info-card/person-info-card.component.tsx +8 -2
  31. package/src/components/organisms/person-info-card/person-info-card.preview.tsx +3 -0
  32. package/src/components/organisms/person-info-card/person-info-card.styles.d.ts +4 -0
  33. package/src/components/organisms/person-info-card/person-info-card.styles.js +4 -0
  34. package/src/components/organisms/text-bubble/text-bubble.component.d.ts +2 -2
  35. package/src/components/organisms/text-bubble/text-bubble.component.tsx +6 -3
  36. package/src/components/organisms/text-bubble/text-bubble.preview.tsx +19 -7
  37. package/src/components/templates/popover-action/popover-action.component.tsx +9 -8
  38. package/src/icons/solid/cloud-download/cloud-download.icon.tsx +1 -1
  39. package/src/icons/solid/refresh/refresh-solid.icon.tsx +2 -2
  40. package/src/utilities/datetime/clock.class.tsx +14 -0
  41. package/src/utilities/datetime/dateonly.class.tsx +287 -0
  42. package/src/utilities/datetime/datetime.class.tsx +288 -0
  43. package/src/utilities/datetime/day.class.tsx +48 -0
  44. package/src/utilities/datetime/dayjs-config.ts +96 -0
  45. package/src/utilities/datetime/dayoftheweek.class.tsx +242 -0
  46. package/src/utilities/datetime/hour.class.tsx +60 -0
  47. package/src/utilities/datetime/locale.tsx +6 -0
  48. package/src/utilities/datetime/millisecond.class.tsx +48 -0
  49. package/src/utilities/datetime/minute.class.tsx +55 -0
  50. package/src/utilities/datetime/month.class.tsx +74 -0
  51. package/src/utilities/datetime/second.class.tsx +52 -0
  52. package/src/utilities/datetime/time.class.tsx +190 -0
  53. package/src/utilities/datetime/timezone.class.tsx +36 -0
  54. package/src/utilities/datetime/year.class.tsx +78 -0
  55. package/src/utilities/datetime/yearandmonth.class.tsx +80 -0
  56. package/src/components/atoms/background-gradient/__snapshots__/background-gradient.test.js.snap +0 -40
  57. package/src/components/atoms/background-gradient/background-gradient.test.js +0 -10
  58. package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +0 -6817
  59. package/src/components/atoms/calendar/calendar.test.js +0 -35
  60. package/src/components/atoms/check-switch/__snapshots__/check-switch.test.js.snap +0 -84
  61. package/src/components/atoms/check-switch/check-switch.test.js +0 -13
  62. package/src/components/atoms/heading-components/all-caps-heading/__snapshots__/all-caps-heading.test.js.snap +0 -113
  63. package/src/components/atoms/heading-components/all-caps-heading/all-caps-heading.test.js +0 -44
  64. package/src/components/atoms/heading-components/heading1/__snapshots__/heading1.test.js.snap +0 -121
  65. package/src/components/atoms/heading-components/heading1/heading1.test.js +0 -51
  66. package/src/components/atoms/heading-components/heading2/__snapshots__/heading2.test.js.snap +0 -121
  67. package/src/components/atoms/heading-components/heading2/heading2.test.js +0 -51
  68. package/src/components/atoms/heading-components/heading3/__snapshots__/heading3.test.js.snap +0 -121
  69. package/src/components/atoms/heading-components/heading3/heading3.test.js +0 -51
  70. package/src/components/atoms/heading-components/heading4/__snapshots__/heading4.test.js.snap +0 -121
  71. package/src/components/atoms/heading-components/heading4/heading4.test.js +0 -51
  72. package/src/components/atoms/image-bubble/__snapshots__/image-bubble.test.js.snap +0 -67
  73. package/src/components/atoms/image-bubble/image-bubble.test.js +0 -20
  74. package/src/components/atoms/increment-input/__snapshots__/increment-input.test.js.snap +0 -269
  75. package/src/components/atoms/increment-input/increment-input.test.js +0 -14
  76. package/src/components/atoms/logo/__snapshots__/logo.test.js.snap +0 -113
  77. package/src/components/atoms/logo/logo.test.js +0 -16
  78. package/src/components/atoms/paragraph-components/paragraph/__snapshots__/paragraph.test.js.snap +0 -121
  79. package/src/components/atoms/paragraph-components/paragraph/paragraph.test.js +0 -76
  80. package/src/components/atoms/paragraph-components/small-text/__snapshots__/small-text.test.js.snap +0 -121
  81. package/src/components/atoms/paragraph-components/small-text/small-text.test.js +0 -76
  82. package/src/components/atoms/paragraph-components/tiny-text/__snapshots__/tiny-text.test.js.snap +0 -121
  83. package/src/components/atoms/paragraph-components/tiny-text/tiny-text.test.js +0 -76
  84. package/src/components/atoms/quick-message/__snapshots__/quick-message.test.js.snap +0 -143
  85. package/src/components/atoms/quick-message/quick-message.test.js +0 -58
  86. package/src/components/atoms/split-container/__snapshots__/split-container.test.js.snap +0 -333
  87. package/src/components/atoms/split-container/split-container.test.js +0 -45
  88. package/src/components/atoms/text-input/__snapshots__/text-input.test.js.snap +0 -123
  89. package/src/components/atoms/text-input/text-input.test.js +0 -59
  90. package/src/components/molecules/avatar/__snapshots__/avatar.test.js.snap +0 -97
  91. package/src/components/molecules/avatar/avatar.test.js +0 -22
  92. package/src/components/molecules/blocked-message/__snapshots__/blocked-message.test.js.snap +0 -107
  93. package/src/components/molecules/blocked-message/blocked-message.test.js +0 -12
  94. package/src/components/molecules/button/__snapshots__/button.test.js.snap +0 -652
  95. package/src/components/molecules/button/button.test.js +0 -56
  96. package/src/components/molecules/calendar-select/__snapshots__/calendar-select.test.js.snap +0 -343
  97. package/src/components/molecules/calendar-select/calendar-select.test.js +0 -20
  98. package/src/components/molecules/cancel-link/__snapshots__/cancel-link.test.js.snap +0 -139
  99. package/src/components/molecules/cancel-link/cancel-link.test.js +0 -28
  100. package/src/components/molecules/checkbox/__snapshots__/checkbox.test.js.snap +0 -176
  101. package/src/components/molecules/checkbox/checkbox.test.js +0 -30
  102. package/src/components/molecules/contact-role/__snapshots__/contact-role.test.js.snap +0 -113
  103. package/src/components/molecules/contact-role/contact-role.test.js +0 -18
  104. package/src/components/molecules/date-input/__snapshots__/date-input.test.js.snap +0 -140
  105. package/src/components/molecules/date-input/date-input.test.js +0 -23
  106. package/src/components/molecules/day/__snapshots__/day.test.js.snap +0 -263
  107. package/src/components/molecules/day/day.test.js +0 -37
  108. package/src/components/molecules/default-select/__snapshots__/default-select.test.js.snap +0 -140
  109. package/src/components/molecules/default-select/default-select.test.js +0 -17
  110. package/src/components/molecules/department_logo/__snapshots__/department-logo.test.js.snap +0 -27
  111. package/src/components/molecules/department_logo/department-logo.test.js +0 -12
  112. package/src/components/molecules/failed-to-send/__snapshots__/failed-bubble.test.js.snap +0 -386
  113. package/src/components/molecules/failed-to-send/failed-bubble.test.js +0 -75
  114. package/src/components/molecules/filter-range/__snapshots__/filter-range.test.js.snap +0 -208
  115. package/src/components/molecules/filter-range/filter-range.test.js +0 -20
  116. package/src/components/molecules/filter-tab/__snapshots__/filter-tab.test.js.snap +0 -536
  117. package/src/components/molecules/filter-tab/filter-tab.test.js +0 -42
  118. package/src/components/molecules/info/__snapshots__/info.test.js.snap +0 -64
  119. package/src/components/molecules/info/info.test.js +0 -18
  120. package/src/components/molecules/language-button/__snapshots__/language-button.test.js.snap +0 -129
  121. package/src/components/molecules/language-button/language-button.test.js +0 -29
  122. package/src/components/molecules/message-input/__snapshots__/message-input.test.js.snap +0 -611
  123. package/src/components/molecules/message-input/message-input.test.js +0 -63
  124. package/src/components/molecules/more-info-button/__snapshots__/more-info-button.test.js.snap +0 -133
  125. package/src/components/molecules/more-info-button/more-info-button.test.js +0 -29
  126. package/src/components/molecules/password-input/__snapshots__/password-input.test.js.snap +0 -504
  127. package/src/components/molecules/password-input/password-input.test.js +0 -46
  128. package/src/components/molecules/pill/__snapshots__/pill.test.js.snap +0 -226
  129. package/src/components/molecules/pill/pill.test.js +0 -42
  130. package/src/components/molecules/pressable-icon/__snapshots__/pressable-icon.test.js.snap +0 -460
  131. package/src/components/molecules/pressable-icon/pressable-icon.test.js +0 -51
  132. package/src/components/molecules/quick-filter/__snapshots__/quick-filter.test.js.snap +0 -557
  133. package/src/components/molecules/quick-filter/quick-filter.test.js +0 -134
  134. package/src/components/molecules/search-input/__snapshots__/search.test.js.snap +0 -145
  135. package/src/components/molecules/search-input/search.test.js +0 -22
  136. package/src/components/molecules/select-link/__snapshots__/select-link.test.js.snap +0 -70
  137. package/src/components/molecules/select-link/select-link.test.js +0 -17
  138. package/src/components/molecules/select-list-item/__snapshots__/select-list-item.test.js.snap +0 -762
  139. package/src/components/molecules/select-list-item/select-list-item.test.js +0 -38
  140. package/src/components/molecules/select-picker/__snapshots__/select-picker.test.js.snap +0 -407
  141. package/src/components/molecules/select-picker/select-picker.test.js +0 -31
  142. package/src/components/molecules/send-bubble/__snapshots__/send-text-bubble.test.js.snap +0 -1979
  143. package/src/components/molecules/send-bubble/send-text-bubble.test.js +0 -156
  144. package/src/components/molecules/snackbar/__snapshots__/snackbar.test.js.snap +0 -557
  145. package/src/components/molecules/snackbar/snackbar.test.js +0 -35
  146. package/src/components/molecules/swipe/__snapshots__/swipe.test.js.snap +0 -340
  147. package/src/components/molecules/swipe/swipe.test.js +0 -46
  148. package/src/components/molecules/tag/__snapshots__/tag.test.js.snap +0 -139
  149. package/src/components/molecules/tag/tag.test.js +0 -34
  150. package/src/components/molecules/time-picker/__snapshots__/time-picker.test.js.snap +0 -2221
  151. package/src/components/molecules/time-picker/time-picker.test.js +0 -18
  152. package/src/components/molecules/time-tracker/__snapshots__/time-tracker.test.js.snap +0 -266
  153. package/src/components/molecules/time-tracker/time-tracker.test.js +0 -36
  154. package/src/components/molecules/timeline/__snapshots__/timeline.test.js.snap +0 -257
  155. package/src/components/molecules/timeline/timeline.test.js +0 -18
  156. package/src/components/molecules/timestamp/__snapshots__/timestamp.test.js.snap +0 -28
  157. package/src/components/molecules/timestamp/timestamp.test.js +0 -16
  158. package/src/components/molecules/wave-background/__snapshots__/wave.test.js.snap +0 -173
  159. package/src/components/molecules/wave-background/wave.test.js +0 -25
  160. package/src/components/molecules/wide-button/__snapshots__/wide-button.test.js.snap +0 -269
  161. package/src/components/molecules/wide-button/wide-button.test.js +0 -30
  162. package/src/components/organisms/child-list-item/__snapshots__/child-list-item.test.js.snap +0 -1040
  163. package/src/components/organisms/child-list-item/child-list-item.test.js +0 -75
  164. package/src/components/organisms/contact-item/__snapshots__/contact-item.test.js.snap +0 -404
  165. package/src/components/organisms/contact-item/contact-item.test.js +0 -22
  166. package/src/components/organisms/loading-indicator/__snapshots__/loading-indicator.test.js.snap +0 -474
  167. package/src/components/organisms/loading-indicator/loading-indicator.test.js +0 -41
  168. package/src/components/organisms/my-child-list-item/__snapshots__/my-child-list-item.test.js.snap +0 -293
  169. package/src/components/organisms/my-child-list-item/my-child-list-item.test.js +0 -23
  170. package/src/components/organisms/person-info-card/__snapshots__/person-info-card.test.js.snap +0 -709
  171. package/src/components/organisms/person-info-card/person-info-card.test.js +0 -85
  172. package/src/components/organisms/text-bubble/__snapshots__/text-bubble.test.js.snap +0 -3046
  173. package/src/components/organisms/text-bubble/text-bubble.test.js +0 -144
  174. package/src/utilities/toddle-datetime/interfaces/duration.interface.d.ts +0 -22
  175. package/src/utilities/toddle-datetime/interfaces/duration.interface.tsx +0 -23
  176. package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.d.ts +0 -22
  177. package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.tsx +0 -25
  178. package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +0 -50
  179. package/src/utilities/toddle-datetime/toddle-datetime.class.tsx +0 -206
  180. package/src/utilities/toddle-datetime/toddle-datetime.preview.d.ts +0 -2
  181. package/src/utilities/toddle-datetime/toddle-datetime.preview.tsx +0 -160
  182. package/src/utilities/toddle-datetime/toddle-datetime.test.js +0 -127
  183. package/src/utilities/toddle-datetime/types/duration.type.d.ts +0 -4
  184. package/src/utilities/toddle-datetime/types/duration.type.tsx +0 -6
  185. package/src/utilities/toddle-datetime/types/toddle-datetime.type.d.ts +0 -5
  186. package/src/utilities/toddle-datetime/types/toddle-datetime.type.tsx +0 -23
@@ -1,140 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`test default select component should render a default select component that accepts a label and onPress does something 1`] = `
4
- <View
5
- accessibilityState={
6
- {
7
- "busy": undefined,
8
- "checked": undefined,
9
- "disabled": undefined,
10
- "expanded": undefined,
11
- "selected": undefined,
12
- }
13
- }
14
- accessibilityValue={
15
- {
16
- "max": undefined,
17
- "min": undefined,
18
- "now": undefined,
19
- "text": undefined,
20
- }
21
- }
22
- accessible={true}
23
- collapsable={false}
24
- focusable={true}
25
- onBlur={[Function]}
26
- onClick={[Function]}
27
- onFocus={[Function]}
28
- onResponderGrant={[Function]}
29
- onResponderMove={[Function]}
30
- onResponderRelease={[Function]}
31
- onResponderTerminate={[Function]}
32
- onResponderTerminationRequest={[Function]}
33
- onStartShouldSetResponder={[Function]}
34
- style={
35
- [
36
- {
37
- "backgroundColor": "#7B93DB",
38
- },
39
- {
40
- "alignItems": "center",
41
- "borderRadius": 8,
42
- "flexDirection": "row",
43
- "justifyContent": "space-between",
44
- "paddingBottom": 16,
45
- "paddingLeft": 16,
46
- "paddingRight": 16,
47
- "paddingTop": 16,
48
- "width": "100%",
49
- },
50
- ]
51
- }
52
- >
53
- <View>
54
- <Text
55
- style={
56
- [
57
- [
58
- {
59
- "fontFamily": "SourceSansProBold",
60
- "fontSize": 18,
61
- "lineHeight": 22.6,
62
- },
63
- ],
64
- {
65
- "color": "#FFFFFF",
66
- "textAlign": undefined,
67
- "width": "100%",
68
- },
69
- undefined,
70
- ]
71
- }
72
- >
73
- Alle leefgroepen
74
- </Text>
75
- </View>
76
- <RNSVGSvgView
77
- align="xMidYMid"
78
- bbHeight="24"
79
- bbWidth="24"
80
- fill="none"
81
- focusable={false}
82
- height={24}
83
- meetOrSlice={0}
84
- minX={0}
85
- minY={0}
86
- style={
87
- [
88
- {
89
- "backgroundColor": "transparent",
90
- "borderWidth": 0,
91
- },
92
- {
93
- "flex": 0,
94
- "height": 24,
95
- "width": 24,
96
- },
97
- ]
98
- }
99
- vbHeight={19}
100
- vbWidth={11}
101
- width={24}
102
- >
103
- <RNSVGGroup
104
- fill={null}
105
- propList={
106
- [
107
- "fill",
108
- ]
109
- }
110
- >
111
- <RNSVGPath
112
- d="M1.75 1.625L9.33333 9.5L1.75 17.375"
113
- fill={
114
- {
115
- "payload": 4278190080,
116
- "type": 0,
117
- }
118
- }
119
- propList={
120
- [
121
- "stroke",
122
- "strokeWidth",
123
- "strokeLinecap",
124
- "strokeLinejoin",
125
- ]
126
- }
127
- stroke={
128
- {
129
- "payload": 4294967295,
130
- "type": 0,
131
- }
132
- }
133
- strokeLinecap={1}
134
- strokeLinejoin={1}
135
- strokeWidth="2"
136
- />
137
- </RNSVGGroup>
138
- </RNSVGSvgView>
139
- </View>
140
- `;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import render from 'react-test-renderer';
3
- import {DefaultSelect} from './default-select.component';
4
-
5
- describe('test default select component', () => {
6
- it('should render a default select component that accepts a label and onPress does something', () => {
7
- const tree = render
8
- .create(
9
- <DefaultSelect
10
- label={'Alle leefgroepen'}
11
- onPress={() => console.log('pressed')}
12
- />
13
- )
14
- .toJSON();
15
- expect(tree).toMatchSnapshot();
16
- });
17
- });
@@ -1,27 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`test department-logo component should render a department-logo component 1`] = `
4
- <Text
5
- style={
6
- [
7
- [
8
- {
9
- "fontFamily": "Montserrat",
10
- "fontSize": 13,
11
- "lineHeight": 20.4,
12
- },
13
- ],
14
- {
15
- "color": "#19216C",
16
- "textAlign": undefined,
17
- "width": "100%",
18
- },
19
- {
20
- "textAlignVertical": "bottom",
21
- },
22
- ]
23
- }
24
- >
25
- Test Department
26
- </Text>
27
- `;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import render from 'react-test-renderer';
3
- import {DepartmentLogo} from './department-logo.component';
4
-
5
- describe('test department-logo component', () => {
6
- it('should render a department-logo component', function () {
7
- const tree = render
8
- .create(<DepartmentLogo department={'Test Department'} />)
9
- .toJSON();
10
- expect(tree).toMatchSnapshot();
11
- });
12
- });
@@ -1,386 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Failed text bubble test shows a failed to send text bubble that is swipeable with refresh and trash icon, which if we press them we can resend or delete the message 1`] = `
4
- <View
5
- style={
6
- {
7
- "flexDirection": "row",
8
- "gap": 12,
9
- }
10
- }
11
- >
12
- <View
13
- style={
14
- {
15
- "justifyContent": "center",
16
- "padding": 2,
17
- }
18
- }
19
- >
20
- <RNSVGSvgView
21
- align="xMidYMid"
22
- bbHeight="26"
23
- bbWidth="26"
24
- fill="none"
25
- focusable={false}
26
- height={26}
27
- meetOrSlice={0}
28
- minX={0}
29
- minY={0}
30
- style={
31
- [
32
- {
33
- "backgroundColor": "transparent",
34
- "borderWidth": 0,
35
- },
36
- {
37
- "flex": 0,
38
- "height": 26,
39
- "width": 26,
40
- },
41
- ]
42
- }
43
- vbHeight={23}
44
- vbWidth={22}
45
- width={26}
46
- >
47
- <RNSVGGroup
48
- fill={null}
49
- propList={
50
- [
51
- "fill",
52
- ]
53
- }
54
- >
55
- <RNSVGPath
56
- d="M11 7V11.5M11 16H11.0108M20.75 11.5C20.75 17.0919 16.3848 21.625 11 21.625C5.61522 21.625 1.25 17.0919 1.25 11.5C1.25 5.90812 5.61522 1.375 11 1.375C16.3848 1.375 20.75 5.90812 20.75 11.5Z"
57
- fill={
58
- {
59
- "payload": 4278190080,
60
- "type": 0,
61
- }
62
- }
63
- propList={
64
- [
65
- "stroke",
66
- "strokeWidth",
67
- "strokeLinecap",
68
- "strokeLinejoin",
69
- ]
70
- }
71
- stroke={
72
- {
73
- "payload": 4294010984,
74
- "type": 0,
75
- }
76
- }
77
- strokeLinecap={1}
78
- strokeLinejoin={1}
79
- strokeWidth="2"
80
- />
81
- </RNSVGGroup>
82
- </RNSVGSvgView>
83
- </View>
84
- <View
85
- style={
86
- {
87
- "backgroundColor": "#F16868",
88
- "borderBottomLeftRadius": 8,
89
- "borderBottomRightRadius": 32,
90
- "borderTopLeftRadius": 24,
91
- "borderTopRightRadius": 24,
92
- "flex": 1,
93
- "justifyContent": "center",
94
- "paddingBottom": 16,
95
- "paddingLeft": 24,
96
- "paddingRight": 24,
97
- "paddingTop": 16,
98
- }
99
- }
100
- >
101
- <View
102
- collapsable={false}
103
- handlerTag={1}
104
- handlerType="PanGestureHandler"
105
- onGestureHandlerEvent={[Function]}
106
- onGestureHandlerStateChange={[Function]}
107
- onLayout={[Function]}
108
- style={
109
- {
110
- "overflow": "hidden",
111
- }
112
- }
113
- >
114
- <View
115
- collapsable={false}
116
- style={
117
- {
118
- "bottom": 0,
119
- "flexDirection": "row-reverse",
120
- "left": 0,
121
- "position": "absolute",
122
- "right": 0,
123
- "top": 0,
124
- "transform": [
125
- {
126
- "translateX": -10000,
127
- },
128
- ],
129
- }
130
- }
131
- >
132
- <View
133
- style={
134
- {
135
- "alignItems": "center",
136
- "flex": 1,
137
- "flexDirection": "row",
138
- "justifyContent": "space-evenly",
139
- }
140
- }
141
- >
142
- <View
143
- collapsable={false}
144
- style={
145
- {
146
- "alignItems": "center",
147
- "justifyContent": "center",
148
- "opacity": 0,
149
- }
150
- }
151
- >
152
- <View
153
- accessibilityState={
154
- {
155
- "busy": undefined,
156
- "checked": undefined,
157
- "disabled": undefined,
158
- "expanded": undefined,
159
- "selected": undefined,
160
- }
161
- }
162
- accessibilityValue={
163
- {
164
- "max": undefined,
165
- "min": undefined,
166
- "now": undefined,
167
- "text": undefined,
168
- }
169
- }
170
- accessible={true}
171
- collapsable={false}
172
- focusable={true}
173
- onBlur={[Function]}
174
- onClick={[Function]}
175
- onFocus={[Function]}
176
- onResponderGrant={[Function]}
177
- onResponderMove={[Function]}
178
- onResponderRelease={[Function]}
179
- onResponderTerminate={[Function]}
180
- onResponderTerminationRequest={[Function]}
181
- onStartShouldSetResponder={[Function]}
182
- testID="refresh-button"
183
- >
184
- <RNSVGSvgView
185
- align="xMidYMid"
186
- bbHeight="24"
187
- bbWidth="24"
188
- fill="none"
189
- focusable={false}
190
- height={24}
191
- meetOrSlice={0}
192
- minX={0}
193
- minY={0}
194
- style={
195
- [
196
- {
197
- "backgroundColor": "transparent",
198
- "borderWidth": 0,
199
- },
200
- {
201
- "flex": 0,
202
- "height": 24,
203
- "width": 24,
204
- },
205
- ]
206
- }
207
- vbHeight={18}
208
- vbWidth={16}
209
- width={24}
210
- >
211
- <RNSVGGroup
212
- fill={null}
213
- propList={
214
- [
215
- "fill",
216
- ]
217
- }
218
- >
219
- <RNSVGPath
220
- d="M1.40005 0.200012C2.00756 0.200012 2.50005 0.692499 2.50005 1.30001V3.61139C3.89715 2.18539 5.84462 1.30001 8.00005 1.30001C11.3544 1.30001 14.2051 3.44426 15.2616 6.43344C15.4641 7.00623 15.1639 7.63468 14.5911 7.83714C14.0183 8.03959 13.3898 7.73937 13.1874 7.16658C12.4318 5.02891 10.3931 3.50001 8.00005 3.50001C6.20162 3.50001 4.60329 4.36353 3.59934 5.70001H6.90005C7.50756 5.70001 8.00005 6.1925 8.00005 6.80001C8.00005 7.40752 7.50756 7.90001 6.90005 7.90001H1.40005C0.792536 7.90001 0.300049 7.40752 0.300049 6.80001V1.30001C0.300049 0.692499 0.792536 0.200012 1.40005 0.200012ZM1.40903 10.1629C1.98182 9.96044 2.61027 10.2607 2.81273 10.8334C3.56828 12.9711 5.60703 14.5 8.00005 14.5C9.79847 14.5 11.3968 13.6365 12.4008 12.3L9.10005 12.3C8.49254 12.3 8.00005 11.8075 8.00005 11.2C8.00005 10.5925 8.49254 10.1 9.10005 10.1H14.6C14.8918 10.1 15.1716 10.2159 15.3779 10.4222C15.5842 10.6285 15.7 10.9083 15.7 11.2V16.7C15.7 17.3075 15.2076 17.8 14.6 17.8C13.9925 17.8 13.5 17.3075 13.5 16.7V14.3886C12.1029 15.8146 10.1555 16.7 8.00005 16.7C4.6457 16.7 1.795 14.5558 0.738478 11.5666C0.536026 10.9938 0.836243 10.3653 1.40903 10.1629Z"
221
- fill={
222
- {
223
- "payload": 4294695385,
224
- "type": 0,
225
- }
226
- }
227
- propList={
228
- [
229
- "fill",
230
- ]
231
- }
232
- />
233
- </RNSVGGroup>
234
- </RNSVGSvgView>
235
- </View>
236
- </View>
237
- <View
238
- collapsable={false}
239
- style={
240
- {
241
- "alignItems": "center",
242
- "justifyContent": "center",
243
- "opacity": 0,
244
- }
245
- }
246
- >
247
- <View
248
- accessibilityState={
249
- {
250
- "busy": undefined,
251
- "checked": undefined,
252
- "disabled": undefined,
253
- "expanded": undefined,
254
- "selected": undefined,
255
- }
256
- }
257
- accessibilityValue={
258
- {
259
- "max": undefined,
260
- "min": undefined,
261
- "now": undefined,
262
- "text": undefined,
263
- }
264
- }
265
- accessible={true}
266
- collapsable={false}
267
- focusable={true}
268
- onBlur={[Function]}
269
- onClick={[Function]}
270
- onFocus={[Function]}
271
- onResponderGrant={[Function]}
272
- onResponderMove={[Function]}
273
- onResponderRelease={[Function]}
274
- onResponderTerminate={[Function]}
275
- onResponderTerminationRequest={[Function]}
276
- onStartShouldSetResponder={[Function]}
277
- testID="delete-button"
278
- >
279
- <RNSVGSvgView
280
- align="xMidYMid"
281
- bbHeight="24"
282
- bbWidth="24"
283
- fill="none"
284
- focusable={false}
285
- height={24}
286
- meetOrSlice={0}
287
- minX={0}
288
- minY={0}
289
- style={
290
- [
291
- {
292
- "backgroundColor": "transparent",
293
- "borderWidth": 0,
294
- },
295
- {
296
- "flex": 0,
297
- "height": 24,
298
- "width": 24,
299
- },
300
- ]
301
- }
302
- vbHeight={18}
303
- vbWidth={17}
304
- width={24}
305
- >
306
- <RNSVGGroup
307
- fill={null}
308
- propList={
309
- [
310
- "fill",
311
- ]
312
- }
313
- >
314
- <RNSVGPath
315
- clipRule={0}
316
- d="M7.34995 0.200012C6.91436 0.200012 6.51616 0.435415 6.32136 0.808077L5.48921 2.40001H1.59995C0.964824 2.40001 0.449951 2.8925 0.449951 3.50001C0.449951 4.10753 0.964824 4.60001 1.59995 4.60001L1.59995 15.6C1.59995 16.815 2.6297 17.8 3.89995 17.8H13.1C14.3702 17.8 15.4 16.815 15.4 15.6V4.60001C16.0351 4.60001 16.55 4.10753 16.55 3.50001C16.55 2.8925 16.0351 2.40001 15.4 2.40001H11.5107L10.6785 0.808077C10.4837 0.435415 10.0855 0.200012 9.64995 0.200012H7.34995ZM5.04995 6.80001C5.04995 6.1925 5.56482 5.70001 6.19995 5.70001C6.83508 5.70001 7.34995 6.1925 7.34995 6.80001V13.4C7.34995 14.0075 6.83508 14.5 6.19995 14.5C5.56482 14.5 5.04995 14.0075 5.04995 13.4V6.80001ZM10.8 5.70001C10.1648 5.70001 9.64995 6.1925 9.64995 6.80001V13.4C9.64995 14.0075 10.1648 14.5 10.8 14.5C11.4351 14.5 11.95 14.0075 11.95 13.4V6.80001C11.95 6.1925 11.4351 5.70001 10.8 5.70001Z"
317
- fill={
318
- {
319
- "payload": 4294695385,
320
- "type": 0,
321
- }
322
- }
323
- fillRule={0}
324
- propList={
325
- [
326
- "fill",
327
- "fillRule",
328
- ]
329
- }
330
- />
331
- </RNSVGGroup>
332
- </RNSVGSvgView>
333
- </View>
334
- </View>
335
- </View>
336
- <View
337
- onLayout={[Function]}
338
- />
339
- </View>
340
- <View
341
- collapsable={false}
342
- handlerTag={2}
343
- handlerType="TapGestureHandler"
344
- onGestureHandlerEvent={[Function]}
345
- onGestureHandlerStateChange={[Function]}
346
- pointerEvents="auto"
347
- style={
348
- {
349
- "transform": [
350
- {
351
- "translateX": -0,
352
- },
353
- ],
354
- }
355
- }
356
- >
357
- <Text
358
- style={
359
- [
360
- [
361
- {
362
- "fontFamily": "Montserrat",
363
- "fontSize": 13,
364
- "lineHeight": 20.4,
365
- },
366
- ],
367
- {
368
- "color": "#FFFFFF",
369
- "textAlign": undefined,
370
- "width": "100%",
371
- },
372
- {
373
- "backgroundColor": "#F16868",
374
- "minHeight": 30,
375
- "textAlignVertical": "center",
376
- },
377
- ]
378
- }
379
- >
380
- Testing our failed bubble
381
- </Text>
382
- </View>
383
- </View>
384
- </View>
385
- </View>
386
- `;
@@ -1,75 +0,0 @@
1
- import React from 'react';
2
- import renderer from 'react-test-renderer';
3
- import {FailedTextBubble} from './failed-bubble.component';
4
- import {render, fireEvent} from '@testing-library/react-native';
5
-
6
- describe('Failed text bubble test', () => {
7
- it('shows a failed to send text bubble that is swipeable with refresh and trash icon, which if we press them we can resend or delete the message', () => {
8
- const tree = renderer
9
- .create(
10
- <FailedTextBubble
11
- id={'1'}
12
- text={'Testing our failed bubble'}
13
- onPressRefresh={() => alert('pressed resend')}
14
- onPressDelete={() => alert('delete the message')}
15
- />
16
- )
17
- .toJSON();
18
-
19
- expect(tree).toMatchSnapshot();
20
- });
21
- });
22
-
23
- describe('FailedTextBubble', () => {
24
- const mockId = '123';
25
- const mockText = 'Failed message';
26
- const mockOnPressRefresh = jest.fn();
27
- const mockOnPressDelete = jest.fn();
28
-
29
- afterEach(() => {
30
- jest.clearAllMocks();
31
- });
32
-
33
- it('should render the component correctly', () => {
34
- const {getByText} = render(
35
- <FailedTextBubble
36
- id={mockId}
37
- text={mockText}
38
- onPressRefresh={mockOnPressRefresh}
39
- onPressDelete={mockOnPressDelete}
40
- />
41
- );
42
-
43
- expect(getByText(mockText)).toBeDefined();
44
- });
45
-
46
- it('should call onPressRefresh when the refresh button is pressed', () => {
47
- const {getByTestId} = render(
48
- <FailedTextBubble
49
- id={mockId}
50
- text={mockText}
51
- onPressRefresh={mockOnPressRefresh}
52
- onPressDelete={mockOnPressDelete}
53
- />
54
- );
55
-
56
- fireEvent.press(getByTestId('refresh-button'));
57
-
58
- expect(mockOnPressRefresh).toHaveBeenCalledWith(mockId);
59
- });
60
-
61
- it('should call onPressDelete when the delete button is pressed', () => {
62
- const {getByTestId} = render(
63
- <FailedTextBubble
64
- id={mockId}
65
- text={mockText}
66
- onPressRefresh={mockOnPressRefresh}
67
- onPressDelete={mockOnPressDelete}
68
- />
69
- );
70
-
71
- fireEvent.press(getByTestId('delete-button'));
72
-
73
- expect(mockOnPressDelete).toHaveBeenCalledWith(mockId);
74
- });
75
- });