@nuskin/react-loyalty-elements 1.1.0-loyalty-mvp.26 → 1.1.0-loyalty-mvp.27
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/package.json
CHANGED
|
@@ -62,7 +62,7 @@ const SubscriptionReward = (props: RewardProgressBarProps) => {
|
|
|
62
62
|
let monthCompletionValue = 0;
|
|
63
63
|
|
|
64
64
|
if (data) {
|
|
65
|
-
const sortedSubs = data.
|
|
65
|
+
const sortedSubs = data.csmMonthlySubsOrderTotal?.sort(
|
|
66
66
|
(a: { year: number; month: number }, b: { year: number; month: number }) => {
|
|
67
67
|
if (a.year === b.year) {
|
|
68
68
|
return b.month - a.month;
|
|
@@ -15,7 +15,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
15
15
|
currentMonthTotal: 150.7,
|
|
16
16
|
nextMonthTotal: 120.0,
|
|
17
17
|
},
|
|
18
|
-
|
|
18
|
+
csmMonthlySubsOrderTotal: [
|
|
19
19
|
{
|
|
20
20
|
accountId: 225167,
|
|
21
21
|
userId: 237,
|
|
@@ -110,7 +110,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
110
110
|
jest.spyOn(application, 'isMobile', 'get').mockReturnValue(false);
|
|
111
111
|
|
|
112
112
|
const mockSubscriptionData = {
|
|
113
|
-
|
|
113
|
+
csmMonthlySubsOrderTotal: [{ totalAmount: 200 }, { totalAmount: 300 }, { totalAmount: 291.8 }],
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
render(<SubscriptionReward subscriptionData={mockSubscriptionData} {...props} />);
|
|
@@ -122,7 +122,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
122
122
|
const customProps = {
|
|
123
123
|
...props,
|
|
124
124
|
subscriptionData: {
|
|
125
|
-
|
|
125
|
+
csmMonthlySubsOrderTotal: [
|
|
126
126
|
{ totalAmount: 150, promoCode: undefined },
|
|
127
127
|
{ totalAmount: 200, promoCode: undefined },
|
|
128
128
|
{ totalAmount: 300, promoCode: undefined },
|
|
@@ -138,7 +138,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
138
138
|
const belowMinAmountProps = {
|
|
139
139
|
...props,
|
|
140
140
|
subscriptionData: {
|
|
141
|
-
|
|
141
|
+
csmMonthlySubsOrderTotal: [
|
|
142
142
|
{ totalAmount: 50 }, // Assuming minAmount is greater than 50
|
|
143
143
|
],
|
|
144
144
|
},
|
|
@@ -152,7 +152,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
152
152
|
const aboveMaxAmountProps = {
|
|
153
153
|
...props,
|
|
154
154
|
subscriptionData: {
|
|
155
|
-
|
|
155
|
+
csmMonthlySubsOrderTotal: [
|
|
156
156
|
{ totalAmount: 350 }, // Assuming maxAmount is less than 350
|
|
157
157
|
],
|
|
158
158
|
},
|
|
@@ -173,7 +173,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
173
173
|
const missingPromoCodeProps = {
|
|
174
174
|
...props,
|
|
175
175
|
subscriptionData: {
|
|
176
|
-
|
|
176
|
+
csmMonthlySubsOrderTotal: [
|
|
177
177
|
{ totalAmount: 150, promoCode: undefined },
|
|
178
178
|
{ totalAmount: 200, promoCode: null },
|
|
179
179
|
{ totalAmount: 300, promoCode: '' },
|
|
@@ -189,7 +189,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
189
189
|
const samePromoCodeBelowThresholdProps = {
|
|
190
190
|
...props,
|
|
191
191
|
subscriptionData: {
|
|
192
|
-
|
|
192
|
+
csmMonthlySubsOrderTotal: [
|
|
193
193
|
{ totalAmount: 50, promoCode: 'CODE1' },
|
|
194
194
|
{ totalAmount: 75, promoCode: 'CODE1' },
|
|
195
195
|
{ totalAmount: 80, promoCode: 'CODE1' },
|
|
@@ -205,7 +205,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
205
205
|
const samePromoCodeProps = {
|
|
206
206
|
...props,
|
|
207
207
|
subscriptionData: {
|
|
208
|
-
|
|
208
|
+
csmMonthlySubsOrderTotal: [
|
|
209
209
|
{ totalAmount: 150, promoCode: 'CODE1' },
|
|
210
210
|
{ totalAmount: 200, promoCode: 'CODE1' },
|
|
211
211
|
{ totalAmount: 300, promoCode: 'CODE1' },
|
|
@@ -274,7 +274,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
274
274
|
const customProps = {
|
|
275
275
|
...props,
|
|
276
276
|
subscriptionData: {
|
|
277
|
-
|
|
277
|
+
csmMonthlySubsOrderTotal: [
|
|
278
278
|
{ totalAmount: 150, promoCode: 'CODE1' },
|
|
279
279
|
{ totalAmount: 200, promoCode: 'CODE1' },
|
|
280
280
|
{ totalAmount: 300, promoCode: 'CODE2' },
|
|
@@ -291,7 +291,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
291
291
|
const customProps = {
|
|
292
292
|
...props,
|
|
293
293
|
subscriptionData: {
|
|
294
|
-
|
|
294
|
+
csmMonthlySubsOrderTotal: [
|
|
295
295
|
{ totalAmount: 150, promoCode: undefined },
|
|
296
296
|
{ totalAmount: 200, promoCode: undefined },
|
|
297
297
|
{ totalAmount: 300, promoCode: undefined },
|
|
@@ -307,7 +307,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
307
307
|
const customProps = {
|
|
308
308
|
...props,
|
|
309
309
|
subscriptionData: {
|
|
310
|
-
|
|
310
|
+
csmMonthlySubsOrderTotal: [
|
|
311
311
|
{ totalAmount: 150, promoCode: 'CODE1' },
|
|
312
312
|
{ totalAmount: 200, promoCode: undefined },
|
|
313
313
|
{ totalAmount: 300, promoCode: 'CODE1' },
|
|
@@ -323,7 +323,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
323
323
|
const customProps = {
|
|
324
324
|
...props,
|
|
325
325
|
subscriptionData: {
|
|
326
|
-
|
|
326
|
+
csmMonthlySubsOrderTotal: [
|
|
327
327
|
{ totalAmount: 50, promoCode: 'CODE1' },
|
|
328
328
|
{ totalAmount: 75, promoCode: 'CODE1' },
|
|
329
329
|
{ totalAmount: 80, promoCode: 'CODE1' },
|
|
@@ -339,7 +339,7 @@ describe('SubscriptionReward Component', () => {
|
|
|
339
339
|
const customProps = {
|
|
340
340
|
...props,
|
|
341
341
|
subscriptionData: {
|
|
342
|
-
|
|
342
|
+
csmMonthlySubsOrderTotal: [
|
|
343
343
|
{ totalAmount: 350, promoCode: 'CODE1' },
|
|
344
344
|
{ totalAmount: 400, promoCode: 'CODE1' },
|
|
345
345
|
{ totalAmount: 450, promoCode: 'CODE1' },
|