@@ -59,6 +59,20 @@ module('Unit | Service | stripev3', function(hooks) {
59
59
createSource . restore ( ) ;
60
60
} ) ;
61
61
62
+ test ( 'makes Stripe.createPaymentMethod available on the service' , function ( assert ) {
63
+ assert . expect ( 1 ) ;
64
+
65
+ let service = this . subject ;
66
+ let mockOptions = { locale : 'en' } ;
67
+
68
+ let createPaymentMethod = sinon . stub ( service , 'createPaymentMethod' ) . callsFake ( function ( options ) {
69
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
70
+ } ) ;
71
+
72
+ createPaymentMethod ( mockOptions ) ;
73
+ createPaymentMethod . restore ( ) ;
74
+ } ) ;
75
+
62
76
test ( 'makes Stripe.retrieveSource available on the service' , function ( assert ) {
63
77
assert . expect ( 1 ) ;
64
78
@@ -86,5 +100,116 @@ module('Unit | Service | stripev3', function(hooks) {
86
100
paymentRequest ( mockOptions ) ;
87
101
paymentRequest . restore ( ) ;
88
102
} ) ;
89
- } ) ;
90
103
104
+ test ( 'makes Stripe.redirectToCheckout available on the service' , function ( assert ) {
105
+ assert . expect ( 1 ) ;
106
+
107
+ let service = this . subject ;
108
+ let mockOptions = { locale : 'en' } ;
109
+
110
+ let redirectToCheckout = sinon . stub ( service , 'redirectToCheckout' ) . callsFake ( function ( options ) {
111
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
112
+ } ) ;
113
+
114
+ redirectToCheckout ( mockOptions ) ;
115
+ redirectToCheckout . restore ( ) ;
116
+ } ) ;
117
+
118
+ test ( 'makes Stripe.retrievePaymentIntent available on the service' , function ( assert ) {
119
+ assert . expect ( 1 ) ;
120
+
121
+ let service = this . subject ;
122
+ let mockOptions = { locale : 'en' } ;
123
+
124
+ let retrievePaymentIntent = sinon . stub ( service , 'retrievePaymentIntent' ) . callsFake ( function ( options ) {
125
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
126
+ } ) ;
127
+
128
+ retrievePaymentIntent ( mockOptions ) ;
129
+ retrievePaymentIntent . restore ( ) ;
130
+ } ) ;
131
+
132
+ test ( 'makes Stripe.handleCardPayment available on the service' , function ( assert ) {
133
+ assert . expect ( 1 ) ;
134
+
135
+ let service = this . subject ;
136
+ let mockOptions = { locale : 'en' } ;
137
+
138
+ let handleCardPayment = sinon . stub ( service , 'handleCardPayment' ) . callsFake ( function ( options ) {
139
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
140
+ } ) ;
141
+
142
+ handleCardPayment ( mockOptions ) ;
143
+ handleCardPayment . restore ( ) ;
144
+ } ) ;
145
+
146
+ test ( 'makes Stripe.handleCardAction available on the service' , function ( assert ) {
147
+ assert . expect ( 1 ) ;
148
+
149
+ let service = this . subject ;
150
+ let mockOptions = { locale : 'en' } ;
151
+
152
+ let handleCardAction = sinon . stub ( service , 'handleCardAction' ) . callsFake ( function ( options ) {
153
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
154
+ } ) ;
155
+
156
+ handleCardAction ( mockOptions ) ;
157
+ handleCardAction . restore ( ) ;
158
+ } ) ;
159
+
160
+ test ( 'makes Stripe.confirmPaymentIntent available on the service' , function ( assert ) {
161
+ assert . expect ( 1 ) ;
162
+
163
+ let service = this . subject ;
164
+ let mockOptions = { locale : 'en' } ;
165
+
166
+ let confirmPaymentIntent = sinon . stub ( service , 'confirmPaymentIntent' ) . callsFake ( function ( options ) {
167
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
168
+ } ) ;
169
+
170
+ confirmPaymentIntent ( mockOptions ) ;
171
+ confirmPaymentIntent . restore ( ) ;
172
+ } ) ;
173
+
174
+ test ( 'makes Stripe.handleCardSetup available on the service' , function ( assert ) {
175
+ assert . expect ( 1 ) ;
176
+
177
+ let service = this . subject ;
178
+ let mockOptions = { locale : 'en' } ;
179
+
180
+ let handleCardSetup = sinon . stub ( service , 'handleCardSetup' ) . callsFake ( function ( options ) {
181
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
182
+ } ) ;
183
+
184
+ handleCardSetup ( mockOptions ) ;
185
+ handleCardSetup . restore ( ) ;
186
+ } ) ;
187
+
188
+ test ( 'makes Stripe.retrieveSetupIntent available on the service' , function ( assert ) {
189
+ assert . expect ( 1 ) ;
190
+
191
+ let service = this . subject ;
192
+ let mockOptions = { locale : 'en' } ;
193
+
194
+ let retrieveSetupIntent = sinon . stub ( service , 'retrieveSetupIntent' ) . callsFake ( function ( options ) {
195
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
196
+ } ) ;
197
+
198
+ retrieveSetupIntent ( mockOptions ) ;
199
+ retrieveSetupIntent . restore ( ) ;
200
+ } ) ;
201
+
202
+ test ( 'makes Stripe.confirmSetupIntent available on the service' , function ( assert ) {
203
+ assert . expect ( 1 ) ;
204
+
205
+ let service = this . subject ;
206
+ let mockOptions = { locale : 'en' } ;
207
+
208
+ let confirmSetupIntent = sinon . stub ( service , 'confirmSetupIntent' ) . callsFake ( function ( options ) {
209
+ assert . deepEqual ( options , mockOptions , 'called with mock options' ) ;
210
+ } ) ;
211
+
212
+ confirmSetupIntent ( mockOptions ) ;
213
+ confirmSetupIntent . restore ( ) ;
214
+ } ) ;
215
+ } ) ;
0 commit comments