@paypal/checkout-components 5.0.402 → 5.0.404-alpha-e012ebc.0
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/dist/button.js +1 -1
- package/dist/test/button.js +1 -1
- package/package.json +1 -1
- package/src/constants/class.js +0 -2
- package/src/funding/paylater/config.jsx +7 -0
- package/src/ui/buttons/button.jsx +1 -5
- package/src/ui/buttons/buttons.jsx +1 -7
- package/src/ui/buttons/props.js +0 -4
- package/src/ui/buttons/styles/button.js +0 -7
- package/src/ui/buttons/styles/styleUtils.js +2 -0
- package/src/ui/buttons/styles/styleUtils.test.constants.js +738 -0
- package/src/ui/buttons/styles/styleUtils.test.js +192 -647
- package/src/zoid/buttons/component.jsx +0 -6
- package/src/ui/buttons/button.test.js +0 -59
|
@@ -325,12 +325,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
325
325
|
},
|
|
326
326
|
|
|
327
327
|
props: {
|
|
328
|
-
disabled: {
|
|
329
|
-
type: "boolean",
|
|
330
|
-
queryParam: true,
|
|
331
|
-
required: false,
|
|
332
|
-
},
|
|
333
|
-
|
|
334
328
|
appSwitchWhenAvailable: {
|
|
335
329
|
type: "boolean",
|
|
336
330
|
queryParam: true,
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
import { describe, test, expect } from "vitest";
|
|
3
|
-
import { noop } from "@krakenjs/belter/src";
|
|
4
|
-
|
|
5
|
-
import { CLASS } from "../../constants/class";
|
|
6
|
-
|
|
7
|
-
import { Button } from "./button";
|
|
8
|
-
|
|
9
|
-
describe("Button", () => {
|
|
10
|
-
test("should apply the disabled class if the disabled prop is passed", () => {
|
|
11
|
-
const mockedButtonProps = {
|
|
12
|
-
buyerCountry: "US",
|
|
13
|
-
commit: false,
|
|
14
|
-
content: null,
|
|
15
|
-
customerId: null,
|
|
16
|
-
env: "test",
|
|
17
|
-
experiment: {},
|
|
18
|
-
flow: "purchase",
|
|
19
|
-
fundingEligibility: {},
|
|
20
|
-
fundingSource: "paypal",
|
|
21
|
-
i: 0,
|
|
22
|
-
instrument: null,
|
|
23
|
-
locale: "en_US",
|
|
24
|
-
multiple: false,
|
|
25
|
-
nonce: "",
|
|
26
|
-
onClick: noop,
|
|
27
|
-
personalization: null,
|
|
28
|
-
showPayLabel: false,
|
|
29
|
-
style: {
|
|
30
|
-
layout: "horizontal",
|
|
31
|
-
shape: "rect",
|
|
32
|
-
borderRadius: 0,
|
|
33
|
-
color: "gold",
|
|
34
|
-
label: "paypal",
|
|
35
|
-
},
|
|
36
|
-
tagline: false,
|
|
37
|
-
userIDToken: null,
|
|
38
|
-
vault: false,
|
|
39
|
-
disabled: true,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// $FlowFixMe
|
|
43
|
-
const jsxElem = Button(mockedButtonProps);
|
|
44
|
-
|
|
45
|
-
// Check that the button has the disabled class
|
|
46
|
-
const buttonElement = jsxElem?.children?.find(
|
|
47
|
-
// $FlowFixMe
|
|
48
|
-
(elem) => elem?.props?.class?.includes(CLASS.DISABLED)
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
expect(buttonElement).toBeDefined();
|
|
52
|
-
expect(
|
|
53
|
-
jsxElem?.children?.some(
|
|
54
|
-
// $FlowFixMe
|
|
55
|
-
(elem) => elem?.props?.class?.includes(CLASS.DISABLED)
|
|
56
|
-
)
|
|
57
|
-
).toBe(true);
|
|
58
|
-
});
|
|
59
|
-
});
|