diff --git a/src/payment/AlertCodeMessages.test.jsx b/src/payment/AlertCodeMessages.test.jsx
index 37fbe2ebf..43758389e 100644
--- a/src/payment/AlertCodeMessages.test.jsx
+++ b/src/payment/AlertCodeMessages.test.jsx
@@ -8,6 +8,8 @@ import {
SingleEnrollmentCodeWarning,
EnrollmentCodeQuantityUpdated,
TransactionDeclined,
+ DynamicPaymentMethodsNotCompatibleError,
+ BasketChangedError,
} from './AlertCodeMessages';
const mockStore = configureMockStore();
@@ -51,3 +53,27 @@ describe('TransactionDeclined', () => {
expect(tree).toMatchSnapshot();
});
});
+
+describe('DynamicPaymentMethodsNotCompatibleError', () => {
+ it('should render with values', () => {
+ const component = (
+
+
+
+ );
+ const { container: tree } = render(component);
+ expect(tree).toMatchSnapshot();
+ });
+});
+
+describe('BasketChangedError', () => {
+ it('should render with values', () => {
+ const component = (
+
+
+
+ );
+ const { container: tree } = render(component);
+ expect(tree).toMatchSnapshot();
+ });
+});
diff --git a/src/payment/__snapshots__/AlertCodeMessages.test.jsx.snap b/src/payment/__snapshots__/AlertCodeMessages.test.jsx.snap
index 09d6ffd77..39ca5ab23 100644
--- a/src/payment/__snapshots__/AlertCodeMessages.test.jsx.snap
+++ b/src/payment/__snapshots__/AlertCodeMessages.test.jsx.snap
@@ -1,5 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`BasketChangedError should render with values 1`] = `
+
+ Your cart has changed since navigating to this page. Please reload the page and verify the product you are purchasing.
+
+`;
+
+exports[`DynamicPaymentMethodsNotCompatibleError should render with values 1`] = `
+
+ The payment method you have selected is not available in your country. Please select another payment method.
+
+`;
+
exports[`EnrollmentCodeQuantityUpdated should render with values 1`] = `
diff --git a/src/payment/checkout/payment-form/CardHolderInformation.test.jsx b/src/payment/checkout/payment-form/CardHolderInformation.test.jsx
index 07481b214..2677badf3 100644
--- a/src/payment/checkout/payment-form/CardHolderInformation.test.jsx
+++ b/src/payment/checkout/payment-form/CardHolderInformation.test.jsx
@@ -74,7 +74,7 @@ describe('', () => {
fireEvent.change(screen.getByLabelText('Country (required)'), { target: { value: 'US' } });
expect(getCountryStatesMap).toHaveBeenCalledWith('US');
- expect(isPostalCodeRequired).toHaveBeenCalledWith('US');
+ expect(isPostalCodeRequired).toHaveBeenCalledWith('US', false); // DPM enabled added to the call
});
});
describe('purchasedForOrganization field', () => {
diff --git a/src/payment/data/redux.test.js b/src/payment/data/redux.test.js
index d1168905b..356ed36d5 100644
--- a/src/payment/data/redux.test.js
+++ b/src/payment/data/redux.test.js
@@ -137,6 +137,27 @@ describe('redux tests', () => {
isRedirect: true, // this is also now true.
});
});
+
+ it('is a Stripe dynamic payment methods redirect', () => {
+ global.history.pushState({}, '', '?payment_intent=pi_123dummy');
+ store = createStore(combineReducers({
+ payment: reducer,
+ }));
+
+ const result = paymentSelector(store.getState());
+ expect(result).toEqual({
+ loading: true,
+ loaded: false,
+ submitting: false,
+ redirect: false, // This is a different kind of redirect, so still false.
+ products: [],
+ isCouponRedeemRedirect: false,
+ isBasketProcessing: false,
+ isEmpty: false,
+ isPaymentRedirect: true, // this is now true
+ isRedirect: false,
+ });
+ });
});
});