Skip to content

Commit 2e8b5bc

Browse files
committed
Update tests + snapshot
1 parent d94914d commit 2e8b5bc

6 files changed

Lines changed: 17 additions & 29 deletions

File tree

modules/@shopify/checkout-sheet-kit/package.snapshot.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
"android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java",
1111
"android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitPackage.java",
1212
"ios/AcceleratedCheckoutButtons.swift",
13+
"ios/AcceleratedCheckoutButtons+Extensions.swift",
1314
"ios/ShopifyCheckoutSheetKit-Bridging-Header.h",
1415
"ios/ShopifyCheckoutSheetKit.mm",
1516
"ios/ShopifyCheckoutSheetKit.swift",
1617
"ios/ShopifyCheckoutSheetKit+EventSerialization.swift",
1718
"ios/ShopifyCheckoutSheetKit+Extensions.swift",
19+
"lib/commonjs/components/AcceleratedCheckoutButtons.js",
20+
"lib/commonjs/components/AcceleratedCheckoutButtons.js.map",
1821
"lib/commonjs/context.js",
1922
"lib/commonjs/context.js.map",
2023
"lib/commonjs/errors.d.js",
@@ -27,6 +30,8 @@
2730
"lib/commonjs/index.js.map",
2831
"lib/commonjs/pixels.d.js",
2932
"lib/commonjs/pixels.d.js.map",
33+
"lib/module/components/AcceleratedCheckoutButtons.js",
34+
"lib/module/components/AcceleratedCheckoutButtons.js.map",
3035
"lib/module/context.js",
3136
"lib/module/context.js.map",
3237
"lib/module/errors.d.js",
@@ -39,6 +44,8 @@
3944
"lib/module/index.js.map",
4045
"lib/module/pixels.d.js",
4146
"lib/module/pixels.d.js.map",
47+
"lib/typescript/src/components/AcceleratedCheckoutButtons.d.ts",
48+
"lib/typescript/src/components/AcceleratedCheckoutButtons.d.ts.map",
4249
"lib/typescript/src/context.d.ts",
4350
"lib/typescript/src/context.d.ts.map",
4451
"lib/typescript/src/index.d.ts",

modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ interface AcceleratedCheckoutButtonsProps {
7878
*/
7979
cornerRadius?: number;
8080

81-
/**
82-
* Style for the container view
83-
*/
84-
style?: ViewStyle;
85-
8681
/**
8782
* Wallets to display in the button
8883
* Defaults to both shopPay and applePay if not specified

modules/@shopify/checkout-sheet-kit/tests/AcceleratedCheckoutButtons.test.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,6 @@ describe('AcceleratedCheckoutButtons', () => {
9292
expect(component.toJSON()).toBeTruthy();
9393
});
9494

95-
it('applies custom styling', () => {
96-
const customStyle = {backgroundColor: 'red', height: 50};
97-
const component = renderer.create(
98-
<AcceleratedCheckoutButtons
99-
cartId="gid://shopify/Cart/123"
100-
style={customStyle}
101-
/>,
102-
);
103-
104-
const tree = component.toJSON();
105-
expect(tree).toBeTruthy();
106-
// @ts-expect-error tree is not null based on check above
107-
expect(tree.props.style).toEqual(customStyle);
108-
});
109-
11095
it('passes through props to native component', () => {
11196
const component = renderer.create(
11297
<AcceleratedCheckoutButtons

modules/@shopify/checkout-sheet-kit/tests/context.test.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,17 @@ describe('ShopifyCheckoutSheetProvider', () => {
6565

6666
expect(
6767
NativeModules.ShopifyCheckoutSheetKit.setConfig,
68-
).not.toHaveBeenCalled();
68+
).toHaveBeenCalledWith(config);
6969
});
7070

7171
it('reuses the same instance across re-renders', () => {
7272
const component = create(<TestComponent>test</TestComponent>);
7373

74-
const firstCallCount =
75-
NativeModules.ShopifyCheckoutSheetKit.setConfig.mock.calls.length;
76-
7774
component.update(<TestComponent>updated</TestComponent>);
7875

79-
const secondCallCount =
80-
NativeModules.ShopifyCheckoutSheetKit.setConfig.mock.calls.length;
81-
82-
expect(secondCallCount).toBe(firstCallCount);
76+
expect(
77+
NativeModules.ShopifyCheckoutSheetKit.setConfig.mock.calls,
78+
).toHaveLength(2);
8379
});
8480
});
8581

modules/@shopify/checkout-sheet-kit/tests/index.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ describe('ShopifyCheckoutSheetKit', () => {
701701

702702
beforeEach(() => {
703703
Platform.OS = 'ios';
704+
Platform.Version = '17.0';
704705
NativeModules.ShopifyCheckoutSheetKit.configureAcceleratedCheckouts.mockReset();
705706
NativeModules.ShopifyCheckoutSheetKit.isAcceleratedCheckoutAvailable.mockReset();
706707
});
@@ -723,6 +724,8 @@ describe('ShopifyCheckoutSheetKit', () => {
723724
'shpat_test_token',
724725
'test@example.com',
725726
'+1234567890',
727+
'merchant.com.test',
728+
['email', 'phone'],
726729
);
727730
});
728731

@@ -745,6 +748,8 @@ describe('ShopifyCheckoutSheetKit', () => {
745748
'shpat_test_token',
746749
null,
747750
null,
751+
null,
752+
[],
748753
);
749754
});
750755

sample/android/app/src/main/AndroidManifest.template.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<category android:name="android.intent.category.BROWSABLE" />
3434

3535
<!-- Note: the host here will be replaced on application start -->
36-
<data android:scheme="https" android:host={{STOREFRONT_DOMAIN}} />
36+
<data android:scheme="https" android:host="{{STOREFRONT_DOMAIN}}" />
3737
</intent-filter>
3838
</activity>
3939
</application>

0 commit comments

Comments
 (0)