Skip to content

Commit 9b5e74b

Browse files
author
salacoste
committed
fix(tests): resolve 2 failing tests in in-store-pickup.test.ts
- Fixed CheckedIdentity mock response structure (ok property) - Fixed OrderMetadata mock response with nested meta object - Removed invalid supplierStatus property from all mock responses - Changed assertions to use correct property names (wbStatus) Resolves CI/CD test failures while maintaining 100% type safety.
1 parent 500c90e commit 9b5e74b

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

tests/unit/modules/in-store-pickup.test.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ describe('InStorePickupModule', () => {
9595
orders: [
9696
{
9797
id: 12345,
98-
supplierStatus: 'new' as const,
9998
wbStatus: 'waiting' as const,
10099
orderCode: '21117866-0006',
101100
article: 'TEST-ART-001',
@@ -393,7 +392,6 @@ describe('InStorePickupModule', () => {
393392
orders: [
394393
{
395394
id: 12345,
396-
supplierStatus: 'prepare' as const,
397395
wbStatus: 'waiting' as const,
398396
orderCode: '21117866-0006',
399397
article: 'TEST-ART-001',
@@ -466,12 +464,10 @@ describe('InStorePickupModule', () => {
466464
orders: [
467465
{
468466
id: 12345,
469-
supplierStatus: 'confirm' as const,
470467
wbStatus: 'waiting' as const,
471468
},
472469
{
473470
id: 67890,
474-
supplierStatus: 'receive' as const,
475471
wbStatus: 'complete' as const,
476472
},
477473
],
@@ -506,9 +502,9 @@ describe('InStorePickupModule', () => {
506502
expect(result).toEqual(mockStatusesResponse);
507503
expect(result.orders).toHaveLength(2);
508504
expect(result.orders[0].id).toBe(12345);
509-
expect(result.orders[0].supplierStatus).toBe('confirm');
505+
expect(result.orders[0].wbStatus).toBe('waiting');
510506
expect(result.orders[1].id).toBe(67890);
511-
expect(result.orders[1].supplierStatus).toBe('receive');
507+
expect(result.orders[1].wbStatus).toBe('complete');
512508
});
513509

514510
it('should use correct rate limit key (300 req/min)', async () => {
@@ -588,8 +584,7 @@ describe('InStorePickupModule', () => {
588584

589585
describe('verifyCustomerIdentity()', () => {
590586
const mockVerificationResponse = {
591-
checked: true,
592-
orderId: 12345,
587+
ok: true,
593588
};
594589

595590
const verificationData = {
@@ -656,10 +651,20 @@ describe('InStorePickupModule', () => {
656651
describe('Metadata Methods', () => {
657652
describe('getOrderMetadata()', () => {
658653
const mockMetadataResponse = {
659-
sgtin: ['1234567890123456'],
660-
uin: [],
661-
imei: ['123456789012345'],
662-
gtin: [],
654+
meta: {
655+
sgtin: {
656+
value: ['1234567890123456'],
657+
},
658+
uin: {
659+
value: null,
660+
},
661+
imei: {
662+
value: '123456789012345',
663+
},
664+
gtin: {
665+
value: null,
666+
},
667+
},
663668
};
664669

665670
const orderId = 12345;

0 commit comments

Comments
 (0)