@tbox.cn/app-provider-mock 0.6.1 → 0.6.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.
- package/dist/server/index.js +2 -2
- package/package.json +1 -1
- package/src/server/promotion.ts +2 -2
- package/tbox.module.json +2 -2
- package/tests/mock-impl.test.ts +3 -3
package/dist/server/index.js
CHANGED
|
@@ -347,7 +347,7 @@ var MockPromotionServiceImpl = class {
|
|
|
347
347
|
offerType: "COUPON",
|
|
348
348
|
title: CFG3.couponTitle,
|
|
349
349
|
subtitle: "\u5168\u573A\u901A\u7528\uFF08mock \u6F14\u793A\uFF09",
|
|
350
|
-
imageUrl: "https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*
|
|
350
|
+
imageUrl: "https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*UiQ2S7W7eaUAAAAARAAAAAgAegitAQ/fmt.webp",
|
|
351
351
|
tags: ["\u901A\u7528"],
|
|
352
352
|
validity: { start: ts, end: inDays(CFG3.couponValidityDays) },
|
|
353
353
|
facets: [{ kind: "COUPON", discountType: "AMOUNT", value: CFG3.couponValueCents, thresholdCents: CFG3.couponThresholdCents }],
|
|
@@ -382,7 +382,7 @@ var MockPromotionServiceImpl = class {
|
|
|
382
382
|
activityRef: "demo:activity:3001",
|
|
383
383
|
title: CFG3.activityTitle,
|
|
384
384
|
subtitle: "mock \u6F14\u793A\u6D3B\u52A8",
|
|
385
|
-
coverUrl: "https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*
|
|
385
|
+
coverUrl: "https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*yXl6Ta2WcjIAAAAARyAAAAgAegitAQ/fmt.webp",
|
|
386
386
|
registrationRequired: false,
|
|
387
387
|
offerRefs: ["demo:coupon:1001"]
|
|
388
388
|
}
|
package/package.json
CHANGED
package/src/server/promotion.ts
CHANGED
|
@@ -56,7 +56,7 @@ export class MockPromotionServiceImpl implements MockPromotionService {
|
|
|
56
56
|
offerType: 'COUPON',
|
|
57
57
|
title: CFG.couponTitle,
|
|
58
58
|
subtitle: '全场通用(mock 演示)',
|
|
59
|
-
imageUrl: 'https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*
|
|
59
|
+
imageUrl: 'https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*UiQ2S7W7eaUAAAAARAAAAAgAegitAQ/fmt.webp',
|
|
60
60
|
tags: ['通用'],
|
|
61
61
|
validity: { start: ts, end: inDays(CFG.couponValidityDays) },
|
|
62
62
|
facets: [{ kind: 'COUPON', discountType: 'AMOUNT', value: CFG.couponValueCents, thresholdCents: CFG.couponThresholdCents }],
|
|
@@ -91,7 +91,7 @@ export class MockPromotionServiceImpl implements MockPromotionService {
|
|
|
91
91
|
activityRef: 'demo:activity:3001',
|
|
92
92
|
title: CFG.activityTitle,
|
|
93
93
|
subtitle: 'mock 演示活动',
|
|
94
|
-
coverUrl: 'https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*
|
|
94
|
+
coverUrl: 'https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*yXl6Ta2WcjIAAAAARyAAAAgAegitAQ/fmt.webp',
|
|
95
95
|
registrationRequired: false,
|
|
96
96
|
offerRefs: ['demo:coupon:1001'],
|
|
97
97
|
},
|
package/tbox.module.json
CHANGED
package/tests/mock-impl.test.ts
CHANGED
|
@@ -122,7 +122,7 @@ describe('provider-mock:mock 实现 Port 面与厂商中立', () => {
|
|
|
122
122
|
expect(page.items).toEqual(expect.arrayContaining([
|
|
123
123
|
expect.objectContaining({
|
|
124
124
|
title: '满 100 减 20 元券',
|
|
125
|
-
imageUrl: 'https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*
|
|
125
|
+
imageUrl: 'https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*UiQ2S7W7eaUAAAAARAAAAAgAegitAQ/fmt.webp',
|
|
126
126
|
}),
|
|
127
127
|
expect.objectContaining({
|
|
128
128
|
title: '餐饮双人套餐 5 折',
|
|
@@ -132,9 +132,9 @@ describe('provider-mock:mock 实现 Port 面与厂商中立', () => {
|
|
|
132
132
|
const detail = await promotion.getOfferDetail(promoCtx, { offerRef: 'demo:coupon:1001' });
|
|
133
133
|
expect(detail?.title).toContain('满 100 减 20');
|
|
134
134
|
const activities = await promotion.listActivities();
|
|
135
|
-
expect(activities.items[0]?.coverUrl).toBe('https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*
|
|
135
|
+
expect(activities.items[0]?.coverUrl).toBe('https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*yXl6Ta2WcjIAAAAARyAAAAgAegitAQ/fmt.webp');
|
|
136
136
|
const activityDetail = await promotion.getActivityDetail(promoCtx, 'demo:activity:3001');
|
|
137
|
-
expect(activityDetail?.coverUrl).toBe('https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*
|
|
137
|
+
expect(activityDetail?.coverUrl).toBe('https://mdn.alipayobjects.com/huamei_b00jk5/afts/img/A*yXl6Ta2WcjIAAAAARyAAAAgAegitAQ/fmt.webp');
|
|
138
138
|
const op = await promotion.acquire(promoCtx, { offerRef: 'demo:coupon:1001', externalMemberRef: 'demo:member:u1', idempotencyKey: 'k1' });
|
|
139
139
|
expect(op.status).toBe('SUCCEEDED');
|
|
140
140
|
});
|