1
1
import nock from "nock" ;
2
2
import { createClient } from "../__mocks__/base" ;
3
- import PaymentsAppApi from "../services/paymentsApp " ;
3
+ import { PaymentsAppAPI } from "../services" ;
4
4
import Client from "../client" ;
5
5
import { PaymentsAppResponse } from "../typings/paymentsApp/models" ;
6
6
7
7
let client : Client ;
8
- let paymentsAppApi : PaymentsAppApi ;
8
+ let paymentsAppService : PaymentsAppAPI ;
9
9
let scope : nock . Scope ;
10
10
11
11
beforeEach ( ( ) : void => {
12
12
if ( ! nock . isActive ( ) ) {
13
13
nock . activate ( ) ;
14
14
}
15
15
client = createClient ( ) ;
16
- paymentsAppApi = new PaymentsAppApi ( client ) ;
16
+ paymentsAppService = new PaymentsAppAPI ( client ) ;
17
17
scope = nock ( "https://management-test.adyen.com/v1" ) ;
18
18
} ) ;
19
19
@@ -35,7 +35,7 @@ describe("PaymentsAppApi", (): void => {
35
35
boardingRequestToken : "mockedRequestToken"
36
36
} ;
37
37
38
- const result = await paymentsAppApi . PaymentsAppApi . generatePaymentsAppBoardingTokenForMerchant ( "testMerchant" , request ) ;
38
+ const result = await paymentsAppService . PaymentsAppApi . generatePaymentsAppBoardingTokenForMerchant ( "testMerchant" , request ) ;
39
39
40
40
expect ( result ) . toBeTruthy ( ) ;
41
41
expect ( result . boardingToken ) . toBe ( "mockedBoardingToken" ) ;
@@ -55,7 +55,7 @@ describe("PaymentsAppApi", (): void => {
55
55
boardingRequestToken : "mockedRequestTokenStore"
56
56
} ;
57
57
58
- const result = await paymentsAppApi . PaymentsAppApi . generatePaymentsAppBoardingTokenForStore ( "testMerchant" , "testStore" , request ) ;
58
+ const result = await paymentsAppService . PaymentsAppApi . generatePaymentsAppBoardingTokenForStore ( "testMerchant" , "testStore" , request ) ;
59
59
60
60
expect ( result ) . toBeTruthy ( ) ;
61
61
expect ( result . boardingToken ) . toBe ( "mockedBoardingTokenStore" ) ;
@@ -73,7 +73,7 @@ describe("PaymentsAppApi", (): void => {
73
73
scope . get ( "/merchants/testMerchant/paymentsApps" )
74
74
. reply ( 200 , mockResponse ) ;
75
75
76
- const result = await paymentsAppApi . PaymentsAppApi . listPaymentsAppForMerchant ( "testMerchant" ) ;
76
+ const result = await paymentsAppService . PaymentsAppApi . listPaymentsAppForMerchant ( "testMerchant" ) ;
77
77
78
78
expect ( result ) . toBeTruthy ( ) ;
79
79
expect ( result . paymentsApps . length ) . toBe ( 2 ) ;
@@ -90,7 +90,7 @@ describe("PaymentsAppApi", (): void => {
90
90
scope . get ( "/merchants/testMerchant/stores/testStore/paymentsApps" )
91
91
. reply ( 200 , mockResponse ) ;
92
92
93
- const result = await paymentsAppApi . PaymentsAppApi . listPaymentsAppForStore ( "testMerchant" , "testStore" ) ;
93
+ const result = await paymentsAppService . PaymentsAppApi . listPaymentsAppForStore ( "testMerchant" , "testStore" ) ;
94
94
95
95
expect ( result ) . toBeTruthy ( ) ;
96
96
expect ( result . paymentsApps . length ) . toBe ( 1 ) ;
@@ -102,7 +102,7 @@ describe("PaymentsAppApi", (): void => {
102
102
. reply ( 200 ) ;
103
103
104
104
await expect (
105
- paymentsAppApi . PaymentsAppApi . revokePaymentsApp ( "testMerchant" , "installation123" )
105
+ paymentsAppService . PaymentsAppApi . revokePaymentsApp ( "testMerchant" , "installation123" )
106
106
) . resolves . toBeUndefined ( ) ;
107
107
} ) ;
108
108
} ) ;
0 commit comments