18
18
import { AssertionError , expect } from 'chai' ;
19
19
import { SinonFakeTimers , SinonStub , stub , useFakeTimers } from 'sinon' ;
20
20
import * as createInstallationRequestModule from '../functions/create-installation-request' ;
21
- import { AppConfig , FirebaseInstallationsImpl } from '../interfaces/installation-impl' ;
21
+ import {
22
+ AppConfig ,
23
+ FirebaseInstallationsImpl
24
+ } from '../interfaces/installation-impl' ;
22
25
import {
23
26
InProgressInstallationEntry ,
24
27
RegisteredInstallationEntry ,
@@ -172,8 +175,12 @@ describe('getInstallationEntry', () => {
172
175
} ) ;
173
176
174
177
it ( 'returns the same FID on subsequent calls' , async ( ) => {
175
- const { installationEntry : entry1 } = await getInstallationEntry ( fakeInstallations ) ;
176
- const { installationEntry : entry2 } = await getInstallationEntry ( fakeInstallations ) ;
178
+ const { installationEntry : entry1 } = await getInstallationEntry (
179
+ fakeInstallations
180
+ ) ;
181
+ const { installationEntry : entry2 } = await getInstallationEntry (
182
+ fakeInstallations
183
+ ) ;
177
184
expect ( entry1 . fid ) . to . equal ( entry2 . fid ) ;
178
185
} ) ;
179
186
@@ -210,7 +217,9 @@ describe('getInstallationEntry', () => {
210
217
it ( 'returns a new unregistered InstallationEntry if app is offline' , async ( ) => {
211
218
stub ( navigator , 'onLine' ) . value ( false ) ;
212
219
213
- const { installationEntry } = await getInstallationEntry ( fakeInstallations ) ;
220
+ const { installationEntry } = await getInstallationEntry (
221
+ fakeInstallations
222
+ ) ;
214
223
215
224
expect ( installationEntry ) . to . deep . equal ( {
216
225
fid : FID ,
@@ -268,7 +277,8 @@ describe('getInstallationEntry', () => {
268
277
// FID generation fails.
269
278
generateInstallationEntrySpy . returns ( generateFidModule . INVALID_FID ) ;
270
279
271
- const getInstallationEntryPromise = getInstallationEntry ( fakeInstallations ) ;
280
+ const getInstallationEntryPromise =
281
+ getInstallationEntry ( fakeInstallations ) ;
272
282
273
283
const { installationEntry, registrationPromise } =
274
284
await getInstallationEntryPromise ;
@@ -308,7 +318,9 @@ describe('getInstallationEntry', () => {
308
318
it ( 'returns the same InstallationEntry if the app is offline' , async ( ) => {
309
319
stub ( navigator , 'onLine' ) . value ( false ) ;
310
320
311
- const { installationEntry } = await getInstallationEntry ( fakeInstallations ) ;
321
+ const { installationEntry } = await getInstallationEntry (
322
+ fakeInstallations
323
+ ) ;
312
324
313
325
expect ( installationEntry ) . to . deep . equal ( {
314
326
fid : FID ,
@@ -331,7 +343,9 @@ describe('getInstallationEntry', () => {
331
343
it ( "returns the same InstallationEntry if the request hasn't timed out" , async ( ) => {
332
344
clock . now = 1_001_000 ; // One second after the request was initiated.
333
345
334
- const { installationEntry } = await getInstallationEntry ( fakeInstallations ) ;
346
+ const { installationEntry } = await getInstallationEntry (
347
+ fakeInstallations
348
+ ) ;
335
349
336
350
expect ( installationEntry ) . to . deep . equal ( {
337
351
fid : FID ,
@@ -420,7 +434,9 @@ describe('getInstallationEntry', () => {
420
434
it ( 'returns a new pending InstallationEntry and triggers createInstallation if the request had already timed out' , async ( ) => {
421
435
clock . now = 1_015_000 ; // Fifteen seconds after the request was initiated.
422
436
423
- const { installationEntry } = await getInstallationEntry ( fakeInstallations ) ;
437
+ const { installationEntry } = await getInstallationEntry (
438
+ fakeInstallations
439
+ ) ;
424
440
425
441
expect ( installationEntry ) . to . deep . equal ( {
426
442
fid : FID ,
@@ -434,7 +450,9 @@ describe('getInstallationEntry', () => {
434
450
stub ( navigator , 'onLine' ) . value ( false ) ;
435
451
clock . now = 1_015_000 ; // Fifteen seconds after the request was initiated.
436
452
437
- const { installationEntry } = await getInstallationEntry ( fakeInstallations ) ;
453
+ const { installationEntry } = await getInstallationEntry (
454
+ fakeInstallations
455
+ ) ;
438
456
439
457
expect ( installationEntry ) . to . deep . equal ( {
440
458
fid : FID ,
@@ -456,7 +474,9 @@ describe('getInstallationEntry', () => {
456
474
} ) ;
457
475
458
476
it ( 'returns the InstallationEntry from the database' , async ( ) => {
459
- const { installationEntry } = await getInstallationEntry ( fakeInstallations ) ;
477
+ const { installationEntry } = await getInstallationEntry (
478
+ fakeInstallations
479
+ ) ;
460
480
461
481
expect ( installationEntry ) . to . deep . equal ( {
462
482
fid : FID ,
0 commit comments