@paypal/checkout-components 5.0.376 → 5.0.377

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paypal/checkout-components",
3
- "version": "5.0.376",
3
+ "version": "5.0.377",
4
4
  "description": "PayPal Checkout components, for integrating checkout products.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -632,6 +632,7 @@ export type ButtonProps = {|
632
632
  hostedButtonId?: string,
633
633
  message?: ButtonMessage,
634
634
  messageMarkup?: string,
635
+ hideSubmitButtonForCardForm?: boolean,
635
636
  |};
636
637
 
637
638
  // eslint-disable-next-line flowtype/require-exact-type
@@ -868,3 +868,31 @@ describe("getButtonColor", () => {
868
868
  });
869
869
  });
870
870
  });
871
+
872
+ describe("HideSubmitButtonProps type validation", () => {
873
+ it("should allow hideSubmitButtonForCardForm as an optional boolean property", () => {
874
+ // This test ensures the Flow type definition accepts the new property
875
+ const validButtonProps = {
876
+ hideSubmitButtonForCardForm: true,
877
+ };
878
+
879
+ // This would fail Flow type checking if the property isn't properly defined
880
+ expect(typeof validButtonProps.hideSubmitButtonForCardForm).toBe("boolean");
881
+ });
882
+
883
+ it("should allow hideSubmitButtonForCardForm to be undefined", () => {
884
+ const validButtonProps = {
885
+ // hideSubmitButtonForCardForm is optional
886
+ };
887
+
888
+ expect(validButtonProps.hideSubmitButtonForCardForm).toBeUndefined();
889
+ });
890
+
891
+ it("should allow hideSubmitButtonForCardForm to be false", () => {
892
+ const validButtonProps = {
893
+ hideSubmitButtonForCardForm: false,
894
+ };
895
+
896
+ expect(validButtonProps.hideSubmitButtonForCardForm).toBe(false);
897
+ });
898
+ });
@@ -1298,6 +1298,18 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
1298
1298
  required: false,
1299
1299
  default: () => window.__TEST_WALLET__,
1300
1300
  },
1301
+
1302
+ hideSubmitButtonForCardForm: {
1303
+ type: "boolean",
1304
+ required: false,
1305
+ queryParam: true,
1306
+ },
1307
+ },
1308
+
1309
+ exports: {
1310
+ submitCardForm: {
1311
+ type: "function",
1312
+ },
1301
1313
  },
1302
1314
  });
1303
1315
  });
@@ -202,6 +202,12 @@ export function getCardFormComponent(): CardFormComponent {
202
202
  value: getDisableCard,
203
203
  },
204
204
  },
205
+
206
+ exports: {
207
+ submit: {
208
+ type: "function",
209
+ },
210
+ },
205
211
  });
206
212
  });
207
213
  }