@@ -127,25 +127,25 @@ describe('IdentityOperationExecutor', () => {
127127 // Retryable
128128 setAddAliasError ( { status : 429 , retryAfter : 10 } ) ;
129129 const res = await executor . _execute ( ops ) ;
130- expect ( res . result ) . toBe ( ExecutionResult . _FailRetry ) ;
131- expect ( res . retryAfterSeconds ) . toBe ( 10 ) ;
130+ expect ( res . _result ) . toBe ( ExecutionResult . _FailRetry ) ;
131+ expect ( res . _retryAfterSeconds ) . toBe ( 10 ) ;
132132
133133 // Invalid
134134 setAddAliasError ( { status : 400 } ) ;
135135 const res2 = await executor . _execute ( ops ) ;
136- expect ( res2 . result ) . toBe ( ExecutionResult . _FailNoretry ) ;
136+ expect ( res2 . _result ) . toBe ( ExecutionResult . _FailNoretry ) ;
137137
138138 // Conflict
139139 setAddAliasError ( { status : 409 , retryAfter : 5 } ) ;
140140 const res3 = await executor . _execute ( ops ) ;
141- expect ( res3 . result ) . toBe ( ExecutionResult . _FailConflict ) ;
142- expect ( res3 . retryAfterSeconds ) . toBe ( 5 ) ;
141+ expect ( res3 . _result ) . toBe ( ExecutionResult . _FailConflict ) ;
142+ expect ( res3 . _retryAfterSeconds ) . toBe ( 5 ) ;
143143
144144 // Unauthorized
145145 setAddAliasError ( { status : 401 , retryAfter : 15 } ) ;
146146 const res4 = await executor . _execute ( ops ) ;
147- expect ( res4 . result ) . toBe ( ExecutionResult . _FailUnauthorized ) ;
148- expect ( res4 . retryAfterSeconds ) . toBe ( 15 ) ;
147+ expect ( res4 . _result ) . toBe ( ExecutionResult . _FailUnauthorized ) ;
148+ expect ( res4 . _retryAfterSeconds ) . toBe ( 15 ) ;
149149
150150 // Missing
151151 setAddAliasError ( { status : 410 } ) ;
@@ -154,15 +154,15 @@ describe('IdentityOperationExecutor', () => {
154154
155155 // no rebuild ops
156156 updateIdentityModel ( 'onesignal_id' , undefined ) ;
157- expect ( res5 . result ) . toBe ( ExecutionResult . _FailNoretry ) ;
158- expect ( res5 . retryAfterSeconds ) . toBeUndefined ( ) ;
157+ expect ( res5 . _result ) . toBe ( ExecutionResult . _FailNoretry ) ;
158+ expect ( res5 . _retryAfterSeconds ) . toBeUndefined ( ) ;
159159
160160 // with rebuild ops
161161 identityModelStore . _model . _onesignalId = ONESIGNAL_ID ;
162162 const res7 = await executor . _execute ( ops ) ;
163- expect ( res7 . result ) . toBe ( ExecutionResult . _FailRetry ) ;
164- expect ( res7 . retryAfterSeconds ) . toBeUndefined ( ) ;
165- expect ( res7 . operations ) . toMatchObject ( [
163+ expect ( res7 . _result ) . toBe ( ExecutionResult . _FailRetry ) ;
164+ expect ( res7 . _retryAfterSeconds ) . toBeUndefined ( ) ;
165+ expect ( res7 . _operations ) . toMatchObject ( [
166166 {
167167 _name : 'login-user' ,
168168 _appId : APP_ID ,
@@ -179,8 +179,8 @@ describe('IdentityOperationExecutor', () => {
179179 newRecordsState . _add ( ONESIGNAL_ID ) ;
180180 setAddAliasError ( { status : 404 , retryAfter : 20 } ) ;
181181 const res6 = await executor . _execute ( ops ) ;
182- expect ( res6 . result ) . toBe ( ExecutionResult . _FailRetry ) ;
183- expect ( res6 . retryAfterSeconds ) . toBe ( 20 ) ;
182+ expect ( res6 . _result ) . toBe ( ExecutionResult . _FailRetry ) ;
183+ expect ( res6 . _retryAfterSeconds ) . toBe ( 20 ) ;
184184 } ) ;
185185
186186 test ( 'should handle deleteAlias errors' , async ( ) => {
@@ -190,36 +190,36 @@ describe('IdentityOperationExecutor', () => {
190190 // Retryable
191191 setDeleteAliasError ( { status : 429 , retryAfter : 10 } ) ;
192192 const res = await executor . _execute ( ops ) ;
193- expect ( res . result ) . toBe ( ExecutionResult . _FailRetry ) ;
194- expect ( res . retryAfterSeconds ) . toBe ( 10 ) ;
193+ expect ( res . _result ) . toBe ( ExecutionResult . _FailRetry ) ;
194+ expect ( res . _retryAfterSeconds ) . toBe ( 10 ) ;
195195
196196 // Invalid
197197 setDeleteAliasError ( { status : 400 } ) ;
198198 const res2 = await executor . _execute ( ops ) ;
199- expect ( res2 . result ) . toBe ( ExecutionResult . _FailNoretry ) ;
199+ expect ( res2 . _result ) . toBe ( ExecutionResult . _FailNoretry ) ;
200200
201201 // Conflict
202202 setDeleteAliasError ( { status : 409 , retryAfter : 5 } ) ;
203203 const res3 = await executor . _execute ( ops ) ;
204- expect ( res3 . result ) . toBe ( ExecutionResult . _Success ) ;
204+ expect ( res3 . _result ) . toBe ( ExecutionResult . _Success ) ;
205205
206206 // Unauthorized
207207 setDeleteAliasError ( { status : 401 , retryAfter : 15 } ) ;
208208 const res4 = await executor . _execute ( ops ) ;
209- expect ( res4 . result ) . toBe ( ExecutionResult . _FailUnauthorized ) ;
210- expect ( res4 . retryAfterSeconds ) . toBe ( 15 ) ;
209+ expect ( res4 . _result ) . toBe ( ExecutionResult . _FailUnauthorized ) ;
210+ expect ( res4 . _retryAfterSeconds ) . toBe ( 15 ) ;
211211
212212 // Missing
213213 setDeleteAliasError ( { status : 410 } ) ;
214214 const res5 = await executor . _execute ( ops ) ;
215- expect ( res5 . result ) . toBe ( ExecutionResult . _Success ) ;
215+ expect ( res5 . _result ) . toBe ( ExecutionResult . _Success ) ;
216216
217217 // in missing retry window
218218 newRecordsState . _add ( ONESIGNAL_ID ) ;
219219 setDeleteAliasError ( { status : 404 , retryAfter : 20 } ) ;
220220 const res6 = await executor . _execute ( ops ) ;
221- expect ( res6 . result ) . toBe ( ExecutionResult . _FailRetry ) ;
222- expect ( res6 . retryAfterSeconds ) . toBe ( 20 ) ;
221+ expect ( res6 . _result ) . toBe ( ExecutionResult . _FailRetry ) ;
222+ expect ( res6 . _retryAfterSeconds ) . toBe ( 20 ) ;
223223 } ) ;
224224 } ) ;
225225} ) ;
0 commit comments