@lookiero/checkout 8.14.0 → 8.15.0
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/dist/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.js +1 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.d.ts +3 -3
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.d.ts +3 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.js +0 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.js +6 -8
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.js +0 -1
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +3 -5
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.js +2 -4
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.d.ts +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.js +1 -2
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.js +9 -18
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.js +1 -1
- package/dist/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.js +1 -1
- package/dist/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.js +1 -1
- package/dist/src/projection/returnQuestion/returnQuestion.d.ts +16 -23
- package/dist/src/projection/returnQuestion/returnQuestion.js +11 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +3 -3
- package/src/infrastructure/projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId.test.ts +9 -4
- package/src/infrastructure/projection/returnQuestion/returnQuestions.mock.ts +117 -72
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.test.tsx +12 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestion.tsx +8 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/ReturnQuestions.test.tsx +9 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/isChildReturnQuestion.ts +1 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.test.tsx +9 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/behaviors/useReturnQuestionItem.tsx +3 -3
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/ReturnQuestionItem.ts +3 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.test.tsx +13 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionFeedbackItem/HostDefaultReturnQuestionFeedbackItem.tsx +2 -4
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.test.tsx +14 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostDefaultReturnQuestionItem/HostDefaultReturnQuestionItem.tsx +7 -13
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostRadioGroupReturnQuestionItem/HostRadioGroupReturnQuestionItem.tsx +5 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +14 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.tsx +5 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/form/HostStackReturnQuestionItem.tsx +3 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.test.tsx +36 -43
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +7 -10
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/modalOptionReturnQuestionItems/ModalOptionReturnQuestionItems.tsx +9 -11
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.test.tsx +14 -8
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/optionReturnQuestionItem/OptionReturnQuestionItem.tsx +4 -6
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/radioReturnQuestionItem/RadioReturnQuestionItem.tsx +4 -6
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.test.tsx +25 -23
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/returnQuestionFeedbackItem/ReturnQuestionFeedbackItem.tsx +3 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.test.tsx +29 -9
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/textareaReturnQuestionItem/TextareaReturnQuestionItem.tsx +5 -7
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/__snapshots__/returnQuestionFeedback.test.ts.snap +4 -5
- package/src/infrastructure/ui/components/organisms/returnQuestions/util/returnQuestionFeedback.ts +18 -32
- package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +26 -24
- package/src/infrastructure/ui/views/item/components/returnQuestionsFeedback/ReturnQuestionsFeedback.tsx +4 -2
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +78 -72
- package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx +1 -1
- package/src/infrastructure/ui/views/shared/components/productVariant/__snapshots__/ProductVariant.test.tsx.snap +4 -4
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx +2 -2
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +30 -28
- package/src/projection/returnQuestion/listReturnQuestionsByCheckoutItemId.test.ts +12 -4
- package/src/projection/returnQuestion/returnQuestion.ts +20 -42
- package/dist/src/projection/returnQuestion/returnQuestion.constants.d.ts +0 -9
- package/dist/src/projection/returnQuestion/returnQuestion.constants.js +0 -10
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.d.ts +0 -12
- package/dist/src/projection/returnQuestion/returnQuestion.metadata.js +0 -1
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.d.ts +0 -5
- package/dist/src/projection/returnQuestion/returnQuestion.typeguard.js +0 -10
- package/src/projection/returnQuestion/returnQuestion.constants.ts +0 -10
- package/src/projection/returnQuestion/returnQuestion.metadata.ts +0 -17
- package/src/projection/returnQuestion/returnQuestion.typeguard.ts +0 -24
|
@@ -88,7 +88,8 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
88
88
|
style={{}}
|
|
89
89
|
>
|
|
90
90
|
<View
|
|
91
|
-
|
|
91
|
+
collapsable={false}
|
|
92
|
+
jestAnimatedStyle={
|
|
92
93
|
{
|
|
93
94
|
"value": {
|
|
94
95
|
"transform": [
|
|
@@ -99,7 +100,6 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
99
100
|
},
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
collapsable={false}
|
|
103
103
|
style={
|
|
104
104
|
{
|
|
105
105
|
"flex": 1,
|
|
@@ -116,16 +116,17 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
116
116
|
testID="carousel-track"
|
|
117
117
|
>
|
|
118
118
|
<View
|
|
119
|
+
collapsable={false}
|
|
120
|
+
jestAnimatedStyle={
|
|
121
|
+
{
|
|
122
|
+
"value": {},
|
|
123
|
+
}
|
|
124
|
+
}
|
|
119
125
|
style={
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
undefined,
|
|
125
|
-
{
|
|
126
|
-
"width": 300,
|
|
127
|
-
},
|
|
128
|
-
]
|
|
126
|
+
{
|
|
127
|
+
"flex": 1,
|
|
128
|
+
"width": 300,
|
|
129
|
+
}
|
|
129
130
|
}
|
|
130
131
|
testID="carousel-item"
|
|
131
132
|
>
|
|
@@ -242,14 +243,14 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
242
243
|
</View>
|
|
243
244
|
</View>
|
|
244
245
|
<Image
|
|
245
|
-
|
|
246
|
+
collapsable={false}
|
|
247
|
+
jestAnimatedStyle={
|
|
246
248
|
{
|
|
247
249
|
"value": {
|
|
248
250
|
"opacity": 0,
|
|
249
251
|
},
|
|
250
252
|
}
|
|
251
253
|
}
|
|
252
|
-
collapsable={false}
|
|
253
254
|
onLoad={[Function]}
|
|
254
255
|
resizeMode="stretch"
|
|
255
256
|
source={
|
|
@@ -274,16 +275,17 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
274
275
|
</View>
|
|
275
276
|
</View>
|
|
276
277
|
<View
|
|
278
|
+
collapsable={false}
|
|
279
|
+
jestAnimatedStyle={
|
|
280
|
+
{
|
|
281
|
+
"value": {},
|
|
282
|
+
}
|
|
283
|
+
}
|
|
277
284
|
style={
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
undefined,
|
|
283
|
-
{
|
|
284
|
-
"width": 300,
|
|
285
|
-
},
|
|
286
|
-
]
|
|
285
|
+
{
|
|
286
|
+
"flex": 1,
|
|
287
|
+
"width": 300,
|
|
288
|
+
}
|
|
287
289
|
}
|
|
288
290
|
testID="carousel-item"
|
|
289
291
|
>
|
|
@@ -400,14 +402,14 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
400
402
|
</View>
|
|
401
403
|
</View>
|
|
402
404
|
<Image
|
|
403
|
-
|
|
405
|
+
collapsable={false}
|
|
406
|
+
jestAnimatedStyle={
|
|
404
407
|
{
|
|
405
408
|
"value": {
|
|
406
409
|
"opacity": 0,
|
|
407
410
|
},
|
|
408
411
|
}
|
|
409
412
|
}
|
|
410
|
-
collapsable={false}
|
|
411
413
|
onLoad={[Function]}
|
|
412
414
|
resizeMode="stretch"
|
|
413
415
|
source={
|
|
@@ -789,7 +791,8 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
789
791
|
style={{}}
|
|
790
792
|
>
|
|
791
793
|
<View
|
|
792
|
-
|
|
794
|
+
collapsable={false}
|
|
795
|
+
jestAnimatedStyle={
|
|
793
796
|
{
|
|
794
797
|
"value": {
|
|
795
798
|
"transform": [
|
|
@@ -800,7 +803,6 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
800
803
|
},
|
|
801
804
|
}
|
|
802
805
|
}
|
|
803
|
-
collapsable={false}
|
|
804
806
|
style={
|
|
805
807
|
{
|
|
806
808
|
"flex": 1,
|
|
@@ -817,16 +819,17 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
817
819
|
testID="carousel-track"
|
|
818
820
|
>
|
|
819
821
|
<View
|
|
822
|
+
collapsable={false}
|
|
823
|
+
jestAnimatedStyle={
|
|
824
|
+
{
|
|
825
|
+
"value": {},
|
|
826
|
+
}
|
|
827
|
+
}
|
|
820
828
|
style={
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
undefined,
|
|
826
|
-
{
|
|
827
|
-
"width": 300,
|
|
828
|
-
},
|
|
829
|
-
]
|
|
829
|
+
{
|
|
830
|
+
"flex": 1,
|
|
831
|
+
"width": 300,
|
|
832
|
+
}
|
|
830
833
|
}
|
|
831
834
|
testID="carousel-item"
|
|
832
835
|
>
|
|
@@ -943,14 +946,14 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
943
946
|
</View>
|
|
944
947
|
</View>
|
|
945
948
|
<Image
|
|
946
|
-
|
|
949
|
+
collapsable={false}
|
|
950
|
+
jestAnimatedStyle={
|
|
947
951
|
{
|
|
948
952
|
"value": {
|
|
949
953
|
"opacity": 0,
|
|
950
954
|
},
|
|
951
955
|
}
|
|
952
956
|
}
|
|
953
|
-
collapsable={false}
|
|
954
957
|
onLoad={[Function]}
|
|
955
958
|
resizeMode="stretch"
|
|
956
959
|
source={
|
|
@@ -975,16 +978,17 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
975
978
|
</View>
|
|
976
979
|
</View>
|
|
977
980
|
<View
|
|
981
|
+
collapsable={false}
|
|
982
|
+
jestAnimatedStyle={
|
|
983
|
+
{
|
|
984
|
+
"value": {},
|
|
985
|
+
}
|
|
986
|
+
}
|
|
978
987
|
style={
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
undefined,
|
|
984
|
-
{
|
|
985
|
-
"width": 300,
|
|
986
|
-
},
|
|
987
|
-
]
|
|
988
|
+
{
|
|
989
|
+
"flex": 1,
|
|
990
|
+
"width": 300,
|
|
991
|
+
}
|
|
988
992
|
}
|
|
989
993
|
testID="carousel-item"
|
|
990
994
|
>
|
|
@@ -1101,14 +1105,14 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
1101
1105
|
</View>
|
|
1102
1106
|
</View>
|
|
1103
1107
|
<Image
|
|
1104
|
-
|
|
1108
|
+
collapsable={false}
|
|
1109
|
+
jestAnimatedStyle={
|
|
1105
1110
|
{
|
|
1106
1111
|
"value": {
|
|
1107
1112
|
"opacity": 0,
|
|
1108
1113
|
},
|
|
1109
1114
|
}
|
|
1110
1115
|
}
|
|
1111
|
-
collapsable={false}
|
|
1112
1116
|
onLoad={[Function]}
|
|
1113
1117
|
resizeMode="stretch"
|
|
1114
1118
|
source={
|
|
@@ -1490,7 +1494,8 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1490
1494
|
style={{}}
|
|
1491
1495
|
>
|
|
1492
1496
|
<View
|
|
1493
|
-
|
|
1497
|
+
collapsable={false}
|
|
1498
|
+
jestAnimatedStyle={
|
|
1494
1499
|
{
|
|
1495
1500
|
"value": {
|
|
1496
1501
|
"transform": [
|
|
@@ -1501,7 +1506,6 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1501
1506
|
},
|
|
1502
1507
|
}
|
|
1503
1508
|
}
|
|
1504
|
-
collapsable={false}
|
|
1505
1509
|
style={
|
|
1506
1510
|
{
|
|
1507
1511
|
"flex": 1,
|
|
@@ -1518,16 +1522,17 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1518
1522
|
testID="carousel-track"
|
|
1519
1523
|
>
|
|
1520
1524
|
<View
|
|
1525
|
+
collapsable={false}
|
|
1526
|
+
jestAnimatedStyle={
|
|
1527
|
+
{
|
|
1528
|
+
"value": {},
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1521
1531
|
style={
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
undefined,
|
|
1527
|
-
{
|
|
1528
|
-
"width": 300,
|
|
1529
|
-
},
|
|
1530
|
-
]
|
|
1532
|
+
{
|
|
1533
|
+
"flex": 1,
|
|
1534
|
+
"width": 300,
|
|
1535
|
+
}
|
|
1531
1536
|
}
|
|
1532
1537
|
testID="carousel-item"
|
|
1533
1538
|
>
|
|
@@ -1644,14 +1649,14 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1644
1649
|
</View>
|
|
1645
1650
|
</View>
|
|
1646
1651
|
<Image
|
|
1647
|
-
|
|
1652
|
+
collapsable={false}
|
|
1653
|
+
jestAnimatedStyle={
|
|
1648
1654
|
{
|
|
1649
1655
|
"value": {
|
|
1650
1656
|
"opacity": 0,
|
|
1651
1657
|
},
|
|
1652
1658
|
}
|
|
1653
1659
|
}
|
|
1654
|
-
collapsable={false}
|
|
1655
1660
|
onLoad={[Function]}
|
|
1656
1661
|
resizeMode="stretch"
|
|
1657
1662
|
source={
|
|
@@ -1676,16 +1681,17 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1676
1681
|
</View>
|
|
1677
1682
|
</View>
|
|
1678
1683
|
<View
|
|
1684
|
+
collapsable={false}
|
|
1685
|
+
jestAnimatedStyle={
|
|
1686
|
+
{
|
|
1687
|
+
"value": {},
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1679
1690
|
style={
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
undefined,
|
|
1685
|
-
{
|
|
1686
|
-
"width": 300,
|
|
1687
|
-
},
|
|
1688
|
-
]
|
|
1691
|
+
{
|
|
1692
|
+
"flex": 1,
|
|
1693
|
+
"width": 300,
|
|
1694
|
+
}
|
|
1689
1695
|
}
|
|
1690
1696
|
testID="carousel-item"
|
|
1691
1697
|
>
|
|
@@ -1802,14 +1808,14 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1802
1808
|
</View>
|
|
1803
1809
|
</View>
|
|
1804
1810
|
<Image
|
|
1805
|
-
|
|
1811
|
+
collapsable={false}
|
|
1812
|
+
jestAnimatedStyle={
|
|
1806
1813
|
{
|
|
1807
1814
|
"value": {
|
|
1808
1815
|
"opacity": 0,
|
|
1809
1816
|
},
|
|
1810
1817
|
}
|
|
1811
1818
|
}
|
|
1812
|
-
collapsable={false}
|
|
1813
1819
|
onLoad={[Function]}
|
|
1814
1820
|
resizeMode="stretch"
|
|
1815
1821
|
source={
|
package/src/infrastructure/ui/views/return/components/returnQuestionsForm/ReturnQuestionsForm.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import { Segment } from "@lookiero/sty-psp-segment";
|
|
|
12
12
|
import { Layout as UiLayout } from "@lookiero/sty-psp-ui";
|
|
13
13
|
import { CheckoutProjection } from "../../../../../../projection/checkout/checkout";
|
|
14
14
|
import { CheckoutItemProjection } from "../../../../../../projection/checkoutItem/checkoutItem";
|
|
15
|
-
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion
|
|
15
|
+
import { ReturnQuestionType } from "../../../../../../projection/returnQuestion/returnQuestion";
|
|
16
16
|
import { useReturnCheckoutItem } from "../../../../../domain/checkoutItem/react/useReturnCheckoutItem";
|
|
17
17
|
import { useListReturnQuestionsByCheckoutItemId } from "../../../../../projection/returnQuestion/react/useListReturnQuestionsByCheckoutItemId";
|
|
18
18
|
import { TrackingPage } from "../../../../../tracking/tracking";
|
|
@@ -181,14 +181,14 @@ exports[`ProductVariant component matches the snapshot for a non-unique size: no
|
|
|
181
181
|
</View>
|
|
182
182
|
</View>
|
|
183
183
|
<Image
|
|
184
|
-
|
|
184
|
+
collapsable={false}
|
|
185
|
+
jestAnimatedStyle={
|
|
185
186
|
{
|
|
186
187
|
"value": {
|
|
187
188
|
"opacity": 0,
|
|
188
189
|
},
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
|
-
collapsable={false}
|
|
192
192
|
onLoad={[Function]}
|
|
193
193
|
resizeMode="contain"
|
|
194
194
|
source={
|
|
@@ -531,14 +531,14 @@ exports[`ProductVariant component matches the snapshot for an unique size: uniqu
|
|
|
531
531
|
</View>
|
|
532
532
|
</View>
|
|
533
533
|
<Image
|
|
534
|
-
|
|
534
|
+
collapsable={false}
|
|
535
|
+
jestAnimatedStyle={
|
|
535
536
|
{
|
|
536
537
|
"value": {
|
|
537
538
|
"opacity": 0,
|
|
538
539
|
},
|
|
539
540
|
}
|
|
540
541
|
}
|
|
541
|
-
collapsable={false}
|
|
542
542
|
onLoad={[Function]}
|
|
543
543
|
resizeMode="contain"
|
|
544
544
|
source={
|
package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/CheckoutItemsTabs.tsx
CHANGED
|
@@ -73,8 +73,8 @@ const CheckoutItemsTabs: FC<CheckoutItemsTabsProps> = ({
|
|
|
73
73
|
|
|
74
74
|
const handleOnPressItem = useCallback((checkoutItemId: string) => onPressItem(checkoutItemId), [onPressItem]);
|
|
75
75
|
|
|
76
|
-
const data = useMemo(() => [0,
|
|
77
|
-
const renderItem: RenderItemFunction<
|
|
76
|
+
const data = useMemo(() => [{ id: "0" }, { id: "1" }], []);
|
|
77
|
+
const renderItem: RenderItemFunction<{ readonly id?: string }> = useCallback(
|
|
78
78
|
({ index }) =>
|
|
79
79
|
index === 0 ? (
|
|
80
80
|
checkoutItemsKept.length === 0 ? (
|
|
@@ -270,7 +270,8 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
270
270
|
style={{}}
|
|
271
271
|
>
|
|
272
272
|
<View
|
|
273
|
-
|
|
273
|
+
collapsable={false}
|
|
274
|
+
jestAnimatedStyle={
|
|
274
275
|
{
|
|
275
276
|
"value": {
|
|
276
277
|
"transform": [
|
|
@@ -281,7 +282,6 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
281
282
|
},
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
|
-
collapsable={false}
|
|
285
285
|
style={
|
|
286
286
|
{
|
|
287
287
|
"flex": 1,
|
|
@@ -298,16 +298,17 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
298
298
|
testID="carousel-track"
|
|
299
299
|
>
|
|
300
300
|
<View
|
|
301
|
+
collapsable={false}
|
|
302
|
+
jestAnimatedStyle={
|
|
303
|
+
{
|
|
304
|
+
"value": {},
|
|
305
|
+
}
|
|
306
|
+
}
|
|
301
307
|
style={
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
false,
|
|
307
|
-
{
|
|
308
|
-
"width": 300,
|
|
309
|
-
},
|
|
310
|
-
]
|
|
308
|
+
{
|
|
309
|
+
"flex": 1,
|
|
310
|
+
"width": 300,
|
|
311
|
+
}
|
|
311
312
|
}
|
|
312
313
|
testID="carousel-item"
|
|
313
314
|
>
|
|
@@ -466,14 +467,14 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
466
467
|
</View>
|
|
467
468
|
</View>
|
|
468
469
|
<Image
|
|
469
|
-
|
|
470
|
+
collapsable={false}
|
|
471
|
+
jestAnimatedStyle={
|
|
470
472
|
{
|
|
471
473
|
"value": {
|
|
472
474
|
"opacity": 0,
|
|
473
475
|
},
|
|
474
476
|
}
|
|
475
477
|
}
|
|
476
|
-
collapsable={false}
|
|
477
478
|
onLoad={[Function]}
|
|
478
479
|
resizeMode="contain"
|
|
479
480
|
source={
|
|
@@ -788,14 +789,14 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
788
789
|
</View>
|
|
789
790
|
</View>
|
|
790
791
|
<Image
|
|
791
|
-
|
|
792
|
+
collapsable={false}
|
|
793
|
+
jestAnimatedStyle={
|
|
792
794
|
{
|
|
793
795
|
"value": {
|
|
794
796
|
"opacity": 0,
|
|
795
797
|
},
|
|
796
798
|
}
|
|
797
799
|
}
|
|
798
|
-
collapsable={false}
|
|
799
800
|
onLoad={[Function]}
|
|
800
801
|
resizeMode="contain"
|
|
801
802
|
source={
|
|
@@ -991,16 +992,17 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
991
992
|
</View>
|
|
992
993
|
</View>
|
|
993
994
|
<View
|
|
995
|
+
collapsable={false}
|
|
996
|
+
jestAnimatedStyle={
|
|
997
|
+
{
|
|
998
|
+
"value": {},
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
994
1001
|
style={
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
false,
|
|
1000
|
-
{
|
|
1001
|
-
"width": 300,
|
|
1002
|
-
},
|
|
1003
|
-
]
|
|
1002
|
+
{
|
|
1003
|
+
"flex": 1,
|
|
1004
|
+
"width": 300,
|
|
1005
|
+
}
|
|
1004
1006
|
}
|
|
1005
1007
|
testID="carousel-item"
|
|
1006
1008
|
>
|
|
@@ -1159,14 +1161,14 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
1159
1161
|
</View>
|
|
1160
1162
|
</View>
|
|
1161
1163
|
<Image
|
|
1162
|
-
|
|
1164
|
+
collapsable={false}
|
|
1165
|
+
jestAnimatedStyle={
|
|
1163
1166
|
{
|
|
1164
1167
|
"value": {
|
|
1165
1168
|
"opacity": 0,
|
|
1166
1169
|
},
|
|
1167
1170
|
}
|
|
1168
1171
|
}
|
|
1169
|
-
collapsable={false}
|
|
1170
1172
|
onLoad={[Function]}
|
|
1171
1173
|
resizeMode="contain"
|
|
1172
1174
|
source={
|
|
@@ -1481,14 +1483,14 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
1481
1483
|
</View>
|
|
1482
1484
|
</View>
|
|
1483
1485
|
<Image
|
|
1484
|
-
|
|
1486
|
+
collapsable={false}
|
|
1487
|
+
jestAnimatedStyle={
|
|
1485
1488
|
{
|
|
1486
1489
|
"value": {
|
|
1487
1490
|
"opacity": 0,
|
|
1488
1491
|
},
|
|
1489
1492
|
}
|
|
1490
1493
|
}
|
|
1491
|
-
collapsable={false}
|
|
1492
1494
|
onLoad={[Function]}
|
|
1493
1495
|
resizeMode="contain"
|
|
1494
1496
|
source={
|
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
import { mock } from "jest-mock-extended";
|
|
2
2
|
import { QueryBus } from "@lookiero/messaging";
|
|
3
|
-
import { returnQuestions } from "../../infrastructure/projection/returnQuestion/returnQuestions.mock";
|
|
4
3
|
import {
|
|
5
4
|
listReturnQuestionsByCheckoutItemId,
|
|
6
5
|
listReturnQuestionsByCheckoutItemIdHandler as sut,
|
|
7
6
|
} from "./listReturnQuestionsByCheckoutItemId";
|
|
7
|
+
import { ReturnQuestionProjection, ReturnQuestionType } from "./returnQuestion";
|
|
8
8
|
|
|
9
9
|
const checkoutItemId = "29790d24-b139-4ab8-b618-d796d101e974";
|
|
10
|
+
const returnQuestionsProjection: ReturnQuestionProjection[] = [
|
|
11
|
+
{
|
|
12
|
+
id: "efe07b97-f6fb-4b6a-ba92-b68519320b2c",
|
|
13
|
+
name: "main_title",
|
|
14
|
+
placeholder: "",
|
|
15
|
+
type: ReturnQuestionType.HOST_DEFAULT,
|
|
16
|
+
},
|
|
17
|
+
];
|
|
10
18
|
const queryBus = mock<QueryBus>();
|
|
11
19
|
const signal = mock<AbortSignal>();
|
|
12
20
|
|
|
13
21
|
describe("listReturnQuestionsByCheckoutItemId", () => {
|
|
14
22
|
it("returns return questions by checkout item id", async () => {
|
|
15
23
|
const query = listReturnQuestionsByCheckoutItemId({ checkoutItemId });
|
|
16
|
-
const view = jest.fn(() => Promise.resolve(
|
|
24
|
+
const view = jest.fn(() => Promise.resolve(returnQuestionsProjection));
|
|
17
25
|
|
|
18
|
-
const
|
|
26
|
+
const returnQuestionsProjectionResult = await sut({ view, queryBus, signal })(query);
|
|
19
27
|
|
|
20
|
-
expect(
|
|
28
|
+
expect(returnQuestionsProjectionResult).toBe(returnQuestionsProjection);
|
|
21
29
|
});
|
|
22
30
|
});
|
|
@@ -1,42 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
type
|
|
21
|
-
? { readonly children: NonEmptyArray<ReturnQuestion> }
|
|
22
|
-
: RQT extends ReturnQuestionTypesWithOptionalChildren
|
|
23
|
-
? { readonly children?: NonEmptyArray<ReturnQuestion> }
|
|
24
|
-
: EmptyObject;
|
|
25
|
-
|
|
26
|
-
type ReturnQuestionTranslationKey<RQT extends ReturnQuestionType> =
|
|
27
|
-
RQT extends ReturnQuestionTypesWithOptionalTranslationKeys
|
|
28
|
-
? { readonly translationKey?: string }
|
|
29
|
-
: { readonly translationKey: string };
|
|
30
|
-
|
|
31
|
-
type ReturnQuestion<RQT extends ReturnQuestionType = ReturnQuestionType> = RQT extends infer K extends
|
|
32
|
-
ReturnQuestionType
|
|
33
|
-
? { readonly id: string; readonly type: K } & ReturnQuestionTranslationKey<K> &
|
|
34
|
-
ReturnQuestionChildren<K> &
|
|
35
|
-
ReturnQuestionMetadata<K>
|
|
36
|
-
: never;
|
|
37
|
-
|
|
38
|
-
export type {
|
|
39
|
-
ReturnQuestion as ReturnQuestionProjection,
|
|
40
|
-
ReturnQuestionTypesWithOptionalTranslationKeys,
|
|
41
|
-
ReturnQuestionTypesWithChildren,
|
|
42
|
-
};
|
|
1
|
+
enum ReturnQuestionType {
|
|
2
|
+
HOST_DEFAULT = "HOST_DEFAULT",
|
|
3
|
+
HOST_TEXTAREA = "HOST_TEXTAREA",
|
|
4
|
+
HOST_SELECT = "HOST_SELECT",
|
|
5
|
+
HOST_STACK = "HOST_STACK",
|
|
6
|
+
TEXTAREA = "TEXTAREA",
|
|
7
|
+
OPTION = "OPTION",
|
|
8
|
+
// ICON = "ICON",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface ReturnQuestionProjection {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly placeholder: string; // required for ReturnQuestionType.SELECT | ReturnQuestionType.TEXTAREA
|
|
15
|
+
readonly type: ReturnQuestionType;
|
|
16
|
+
readonly children?: ReturnQuestionProjection[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { ReturnQuestionType };
|
|
20
|
+
export type { ReturnQuestionProjection };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var ReturnQuestionType;
|
|
2
|
-
(function (ReturnQuestionType) {
|
|
3
|
-
ReturnQuestionType["HOST_DEFAULT"] = "HOST_DEFAULT";
|
|
4
|
-
ReturnQuestionType["HOST_TEXTAREA"] = "HOST_TEXTAREA";
|
|
5
|
-
ReturnQuestionType["HOST_SELECT"] = "HOST_SELECT";
|
|
6
|
-
ReturnQuestionType["HOST_STACK"] = "HOST_STACK";
|
|
7
|
-
ReturnQuestionType["TEXTAREA"] = "TEXTAREA";
|
|
8
|
-
ReturnQuestionType["OPTION"] = "OPTION";
|
|
9
|
-
})(ReturnQuestionType || (ReturnQuestionType = {}));
|
|
10
|
-
export { ReturnQuestionType };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { EmptyObject } from "@lookiero/sty-psp-typescript";
|
|
2
|
-
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
3
|
-
interface ComponentPlaceholder {
|
|
4
|
-
readonly placeholder: string;
|
|
5
|
-
}
|
|
6
|
-
type MetadataDictionary = Record<ReturnQuestionType, EmptyObject>;
|
|
7
|
-
type ComponentMetadata = MetadataDictionary & {
|
|
8
|
-
[ReturnQuestionType.HOST_SELECT]: ComponentPlaceholder;
|
|
9
|
-
[ReturnQuestionType.TEXTAREA]: ComponentPlaceholder;
|
|
10
|
-
};
|
|
11
|
-
type Metadata<RQT extends ReturnQuestionType> = ComponentMetadata[RQT];
|
|
12
|
-
export type { Metadata };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ReturnQuestionProjection, ReturnQuestionTypesWithChildren } from "./returnQuestion";
|
|
2
|
-
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
3
|
-
declare const returnQuestionWithTranslationKey: (question: ReturnQuestionProjection) => question is ReturnQuestionProjection<ReturnQuestionType.HOST_DEFAULT | ReturnQuestionType.HOST_TEXTAREA | ReturnQuestionType.HOST_SELECT | ReturnQuestionType.TEXTAREA | ReturnQuestionType.OPTION>;
|
|
4
|
-
declare const returnQuestionHasChildren: (question: ReturnQuestionProjection) => question is ReturnQuestionProjection<ReturnQuestionTypesWithChildren>;
|
|
5
|
-
export { returnQuestionWithTranslationKey, returnQuestionHasChildren };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ReturnQuestionType } from "./returnQuestion.constants";
|
|
2
|
-
const returnQuestionWithTranslationKey = (question) => Boolean(question.translationKey);
|
|
3
|
-
const returnQuestionHasChildren = (question) => [
|
|
4
|
-
ReturnQuestionType.HOST_DEFAULT,
|
|
5
|
-
ReturnQuestionType.HOST_SELECT,
|
|
6
|
-
ReturnQuestionType.HOST_STACK,
|
|
7
|
-
ReturnQuestionType.HOST_TEXTAREA,
|
|
8
|
-
ReturnQuestionType.OPTION,
|
|
9
|
-
].includes(question.type);
|
|
10
|
-
export { returnQuestionWithTranslationKey, returnQuestionHasChildren };
|