@@ -90,6 +90,7 @@ test('hydrate an active subscription', async ({ page }) => {
90
90
await createNewSubscription ( page )
91
91
92
92
let { subscription } = await storage . get ( [ '4815162342' ] )
93
+ const subscriptionId = subscription . status [ 1 ] . subscription_id
93
94
94
95
// .. and check subscription is active to make sure setup was correct
95
96
let sub = await subscriptionInfo . getAllSubscriptionsStatus ( subscription )
@@ -107,7 +108,7 @@ test('hydrate an active subscription', async ({ page }) => {
107
108
expect ( sub [ '33590' ] ) . toBeFalsy ( )
108
109
109
110
// .. now hydrate status again ..
110
- await subscriptionInfo . hydrateSubscriptionCreated ( [ '4815162342' ] , subscription , 'checkoutId' ) ;
111
+ await subscriptionInfo . hydrateSubscriptionCreated ( [ '4815162342' ] , { subscription_id : subscriptionId } , 'checkoutId' ) ;
111
112
112
113
// .. and expect subscription to be active again
113
114
( { subscription } = await storage . get ( [ '4815162342' ] ) )
@@ -120,13 +121,14 @@ test('does not hydrate if status created was already received', async ({ page })
120
121
await createNewSubscription ( page )
121
122
122
123
let { subscription } = await storage . get ( [ '4815162342' ] )
124
+ const subscriptionId = subscription . status [ 1 ] . subscription_id
123
125
124
126
// .. and check subscription is active to make sure setup was correct
125
127
let sub = await subscriptionInfo . getAllSubscriptionsStatus ( subscription )
126
128
expect ( sub [ '33590' ] ) . toBeTruthy ( )
127
129
128
130
// .. now hydrate status again ..
129
- await subscriptionInfo . hydrateSubscriptionCreated ( [ '4815162342' ] , subscription , 'checkoutId' ) ;
131
+ await subscriptionInfo . hydrateSubscriptionCreated ( [ '4815162342' ] , { subscription_id : subscriptionId } , 'checkoutId' ) ;
130
132
131
133
// .. and expect subscription to be active again
132
134
( { subscription } = await storage . get ( [ '4815162342' ] ) )
@@ -138,6 +140,7 @@ test('hydrate a deleted subscription', async ({ page }) => {
138
140
await createNewSubscription ( page )
139
141
140
142
let { subscription } = await storage . get ( [ '4815162342' ] )
143
+ const subscriptionId = subscription . status [ 1 ] . subscription_id
141
144
142
145
// .. and check subscription is active to make sure setup was correct
143
146
let sub = await subscriptionInfo . getAllSubscriptionsStatus ( subscription )
@@ -163,8 +166,10 @@ test('hydrate a deleted subscription', async ({ page }) => {
163
166
'subscription.payments' : [ ]
164
167
} )
165
168
169
+ console . log ( JSON . stringify ( subscription , null , 2 ) )
170
+
166
171
// .. now hydrate status again ..
167
- await subscriptionInfo . hydrateSubscriptionCancelled ( [ '4815162342' ] , subscription , 'checkoutId' ) ;
172
+ await subscriptionInfo . hydrateSubscriptionCancelled ( [ '4815162342' ] , { subscription_id : subscriptionId } , 'checkoutId' ) ;
168
173
169
174
// .. and expect subscription to be active again
170
175
( { subscription } = await storage . get ( [ '4815162342' ] ) )
0 commit comments