@@ -160,9 +160,9 @@ describe('ShopifyCheckoutSheetKit', () => {
160160 } ) ;
161161
162162 describe ( 'getConfig' , ( ) => {
163- it ( 'returns the parsed config from the Native Module' , ( ) => {
163+ it ( 'returns the parsed config from the Native Module' , async ( ) => {
164164 const instance = new ShopifyCheckoutSheet ( ) ;
165- expect ( instance . getConfig ( ) ) . toStrictEqual ( {
165+ await expect ( instance . getConfig ( ) ) . resolves . toStrictEqual ( {
166166 preloading : true ,
167167 colorScheme : ColorScheme . automatic ,
168168 logLevel : LogLevel . error ,
@@ -732,7 +732,7 @@ describe('ShopifyCheckoutSheetKit', () => {
732732 NativeModule . configureAcceleratedCheckouts . mockReturnValue ( true ) ;
733733
734734 const result =
735- instance . configureAcceleratedCheckouts ( acceleratedConfig ) ;
735+ await instance . configureAcceleratedCheckouts ( acceleratedConfig ) ;
736736
737737 expect ( result ) . toBe ( true ) ;
738738 expect (
@@ -757,7 +757,7 @@ describe('ShopifyCheckoutSheetKit', () => {
757757 } ;
758758 NativeModule . configureAcceleratedCheckouts . mockReturnValue ( true ) ;
759759
760- instance . configureAcceleratedCheckouts ( minimalConfig ) ;
760+ await instance . configureAcceleratedCheckouts ( minimalConfig ) ;
761761
762762 expect (
763763 NativeModule . configureAcceleratedCheckouts ,
@@ -778,7 +778,7 @@ describe('ShopifyCheckoutSheetKit', () => {
778778 const instance = new ShopifyCheckoutSheet ( ) ;
779779
780780 const result =
781- instance . configureAcceleratedCheckouts ( acceleratedConfig ) ;
781+ await instance . configureAcceleratedCheckouts ( acceleratedConfig ) ;
782782
783783 expect ( result ) . toBe ( false ) ;
784784 expect (
@@ -794,9 +794,9 @@ describe('ShopifyCheckoutSheetKit', () => {
794794 } ;
795795 const expectedError = new Error ( '`storefrontDomain` is required' ) ;
796796
797- expect (
797+ await expect (
798798 instance . configureAcceleratedCheckouts ( invalidConfig ) ,
799- ) . toBe ( false ) ;
799+ ) . resolves . toBe ( false ) ;
800800 expect ( console . error ) . toHaveBeenCalledWith (
801801 '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with' ,
802802 expectedError ,
@@ -812,9 +812,9 @@ describe('ShopifyCheckoutSheetKit', () => {
812812
813813 const expectedError = new Error ( '`storefrontAccessToken` is required' ) ;
814814
815- expect (
815+ await expect (
816816 instance . configureAcceleratedCheckouts ( invalidConfig ) ,
817- ) . toBe ( false ) ;
817+ ) . resolves . toBe ( false ) ;
818818 expect ( console . error ) . toHaveBeenCalledWith (
819819 '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with' ,
820820 expectedError ,
@@ -837,9 +837,9 @@ describe('ShopifyCheckoutSheetKit', () => {
837837 '`wallets.applePay.merchantIdentifier` is required' ,
838838 ) ;
839839
840- expect (
840+ await expect (
841841 instance . configureAcceleratedCheckouts ( invalidConfig ) ,
842- ) . toBe ( false ) ;
842+ ) . resolves . toBe ( false ) ;
843843 expect ( console . error ) . toHaveBeenCalledWith (
844844 '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with' ,
845845 expectedError ,
@@ -862,29 +862,29 @@ describe('ShopifyCheckoutSheetKit', () => {
862862 `'wallets.applePay.contactFields' contains unexpected values. Expected "email, phone", received "invalid"` ,
863863 ) ;
864864
865- expect (
865+ await expect (
866866 instance . configureAcceleratedCheckouts ( invalidConfig as any ) ,
867- ) . toBe ( false ) ;
867+ ) . resolves . toBe ( false ) ;
868868 expect ( console . error ) . toHaveBeenCalledWith (
869869 '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with' ,
870870 expectedError ,
871871 ) ;
872872 } ) ;
873873
874- it ( 'does not throw when Apple Pay wallet is not configured' , ( ) => {
874+ it ( 'does not throw when Apple Pay wallet is not configured' , async ( ) => {
875875 const instance = new ShopifyCheckoutSheet ( ) ;
876876 const configWithoutApplePay = {
877877 storefrontDomain : 'test-shop.myshopify.com' ,
878878 storefrontAccessToken : 'shpat_test_token' ,
879879 } ;
880880 NativeModule . configureAcceleratedCheckouts . mockReturnValue ( true ) ;
881881
882- expect (
882+ await expect (
883883 instance . configureAcceleratedCheckouts ( configWithoutApplePay ) ,
884- ) . toBe ( true ) ;
884+ ) . resolves . toBe ( true ) ;
885885 } ) ;
886886
887- it ( 'throws when a non-string value is given for supportedShippingCountries' , ( ) => {
887+ it ( 'throws when a non-string value is given for supportedShippingCountries' , async ( ) => {
888888 const instance = new ShopifyCheckoutSheet ( ) ;
889889 const invalidConfig = {
890890 ...acceleratedConfig ,
@@ -901,9 +901,9 @@ describe('ShopifyCheckoutSheetKit', () => {
901901 `'wallets.applePay.supportedShippingCountries' contains unexpected values. Expects ISO 3166-1 alpha-2 country codes (e.g., "US", "CA", "GB").` ,
902902 ) ;
903903
904- expect (
904+ await expect (
905905 instance . configureAcceleratedCheckouts ( invalidConfig as any ) ,
906- ) . toBe ( false ) ;
906+ ) . resolves . toBe ( false ) ;
907907 expect ( console . error ) . toHaveBeenCalledWith (
908908 '[ShopifyCheckoutSheetKit] Failed to configure accelerated checkouts with' ,
909909 expectedError ,
@@ -913,7 +913,7 @@ describe('ShopifyCheckoutSheetKit', () => {
913913 it ( 'calls configureAcceleratedCheckouts with an empty array for supportShippingCountries when omitted' , async ( ) => {
914914 const instance = new ShopifyCheckoutSheet ( ) ;
915915
916- instance . configureAcceleratedCheckouts ( {
916+ await instance . configureAcceleratedCheckouts ( {
917917 ...acceleratedConfig ,
918918 wallets : {
919919 applePay : {
@@ -940,7 +940,7 @@ describe('ShopifyCheckoutSheetKit', () => {
940940 it ( 'calls configureAcceleratedCheckouts with supportShippingCountries when given' , async ( ) => {
941941 const instance = new ShopifyCheckoutSheet ( ) ;
942942
943- instance . configureAcceleratedCheckouts ( {
943+ await instance . configureAcceleratedCheckouts ( {
944944 ...acceleratedConfig ,
945945 wallets : {
946946 applePay : {
@@ -967,25 +967,25 @@ describe('ShopifyCheckoutSheetKit', () => {
967967 } ) ;
968968
969969 describe ( 'isAcceleratedCheckoutAvailable' , ( ) => {
970- it ( 'calls native isAcceleratedCheckoutAvailable on iOS' , ( ) => {
970+ it ( 'calls native isAcceleratedCheckoutAvailable on iOS' , async ( ) => {
971971 const instance = new ShopifyCheckoutSheet ( ) ;
972972 NativeModule . isAcceleratedCheckoutAvailable . mockReturnValue ( true ) ;
973973
974974 const result = instance . isAcceleratedCheckoutAvailable ( ) ;
975975
976- expect ( result ) . toBe ( true ) ;
976+ await expect ( result ) . resolves . toBe ( true ) ;
977977 expect (
978978 NativeModule . isAcceleratedCheckoutAvailable ,
979979 ) . toHaveBeenCalledTimes ( 1 ) ;
980980 } ) ;
981981
982- it ( 'returns false on Android' , ( ) => {
982+ it ( 'returns false on Android' , async ( ) => {
983983 Platform . OS = 'android' ;
984984 const instance = new ShopifyCheckoutSheet ( ) ;
985985
986986 const result = instance . isAcceleratedCheckoutAvailable ( ) ;
987987
988- expect ( result ) . toBe ( false ) ;
988+ await expect ( result ) . resolves . toBe ( false ) ;
989989 expect (
990990 NativeModule . isAcceleratedCheckoutAvailable ,
991991 ) . not . toHaveBeenCalled ( ) ;
0 commit comments