Skip to content

Commit

Permalink
fix: tests for google pau
Browse files Browse the repository at this point in the history
  • Loading branch information
amihajlovski committed Dec 2, 2024
1 parent 59196fe commit 337d33a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ beforeEach(() => {
paymentMethodsResponse: {
storedPaymentMethods: [{ supportedShopperInteractions: ['Ecommerce'] }],
paymentMethods: [{ type: 'amazonpay' }],
adyenDescriptions: {
amazonpay: 'testDescription'
}
},
}));
window.installments = '[[0,2,["amex","hipercard"]]]';
Expand All @@ -69,11 +72,9 @@ beforeEach(() => {
countryCode: 'mocked_countrycode',
};
getPaymentMethods.mockReturnValue({
json: jest.fn().mockReturnValue({
adyenConnectedTerminals: { uniqueTerminalIds: ['mocked_id'] },
imagePath: 'example.com',
adyenDescriptions: {},
}),
adyenConnectedTerminals: { uniqueTerminalIds: ['mocked_id'] },
imagePath: 'example.com',
adyenDescriptions: {},
});
});
describe('Render Generic Component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ function handlePayment(stateData, order, options) {
let finalResult;
if (!hasStateData) {
if (
(result &&
(JSON.stringify(result).indexOf('amazonpay') > -1 ||
JSON.stringify(result).indexOf('applepay') > -1 ||
JSON.stringify(result).indexOf('cashapp') > -1)) ||
JSON.stringify(result).indexOf('googlepay') > -1
result &&
(JSON.stringify(result).indexOf('amazonpay') > -1 ||
JSON.stringify(result).indexOf('applepay') > -1 ||
JSON.stringify(result).indexOf('googlepay') > -1 ||
JSON.stringify(result).indexOf('cashapp') > -1)
) {
finalResult = JSON.parse(result);
} else {
Expand Down

0 comments on commit 337d33a

Please sign in to comment.