Skip to content

Commit 7251077

Browse files
committed
Fix mocks for failing unit tests
1 parent 0ca507d commit 7251077

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/template-retail-react-app/config/mocks/default.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ module.exports = {
123123
enabled: false
124124
},
125125
storeLocatorEnabled: true,
126-
multishipEnabled: true
126+
multishipEnabled: true,
127+
sfPayments: {
128+
enabled: true,
129+
sdkUrl: '',
130+
metadataUrl: ''
131+
}
127132
},
128133
// This list contains server-side only libraries that you don't want to be compiled by webpack
129134
externals: [],

packages/template-retail-react-app/jest-setup.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ export const setupMockServer = () => {
9696
// Mock Data Cloud API
9797
rest.post('*.c360a.salesforce.com/web/events/*', (req, res, ctx) => {
9898
return res(ctx.delay(0), ctx.status(204), ctx.json({}))
99+
}),
100+
// Mock Salesforce Payments metadata
101+
rest.get('*/payment-metadata', (req, res, ctx) => {
102+
return res(ctx.delay(0), ctx.status(200), ctx.json({}))
103+
}),
104+
rest.get('*/configuration/shopper-configurations/*', (req, res, ctx) => {
105+
return res(ctx.delay(0), ctx.status(200), ctx.json({}))
99106
})
100107
)
101108
}

0 commit comments

Comments
 (0)