@@ -242,7 +242,8 @@ describe('DownloadCenter config', function () {
242
242
} ) ;
243
243
244
244
describe ( 'createAndPublishDownloadCenterConfig' , function ( ) {
245
- let dlCenter : sinon . SinonStub ;
245
+ let dlCenterConfig : sinon . SinonStub ;
246
+ let dlCenterArtifacts : sinon . SinonStub ;
246
247
let uploadConfig : sinon . SinonStub ;
247
248
let downloadConfig : sinon . SinonStub ;
248
249
let uploadAsset : sinon . SinonStub ;
@@ -254,9 +255,17 @@ describe('DownloadCenter config', function () {
254
255
downloadConfig = sinon . stub ( ) ;
255
256
uploadAsset = sinon . stub ( ) ;
256
257
downloadAsset = sinon . stub ( ) ;
257
- dlCenter = sinon . stub ( ) ;
258
+ dlCenterConfig = sinon . stub ( ) ;
259
+ dlCenterArtifacts = sinon . stub ( ) ;
258
260
259
- dlCenter . returns ( {
261
+ dlCenterConfig . returns ( {
262
+ downloadConfig,
263
+ uploadConfig,
264
+ uploadAsset,
265
+ downloadAsset,
266
+ } ) ;
267
+
268
+ dlCenterArtifacts . returns ( {
260
269
downloadConfig,
261
270
uploadConfig,
262
271
uploadAsset,
@@ -280,21 +289,17 @@ describe('DownloadCenter config', function () {
280
289
'' ,
281
290
false ,
282
291
DUMMY_CTA_CONFIG ,
283
- dlCenter as any ,
292
+ dlCenterConfig as any ,
293
+ dlCenterArtifacts as any ,
284
294
baseUrl
285
295
) ;
286
296
287
- expect ( dlCenter ) . to . have . been . calledWith ( {
297
+ expect ( dlCenterConfig ) . to . have . been . calledWith ( {
288
298
bucket : 'info-mongodb-com' ,
289
299
accessKeyId : DUMMY_ACCESS_KEY ,
290
300
secretAccessKey : DUMMY_SECRET_KEY ,
291
301
} ) ;
292
- expect ( dlCenter ) . to . have . been . calledWith ( {
293
- bucket : 'downloads.10gen.com' ,
294
- accessKeyId : DUMMY_ACCESS_KEY ,
295
- secretAccessKey : DUMMY_SECRET_KEY ,
296
- } ) ;
297
- expect ( dlCenter ) . to . have . been . calledWith ( {
302
+ expect ( dlCenterArtifacts ) . to . have . been . calledWith ( {
298
303
bucket : 'cdn-origin-compass' ,
299
304
accessKeyId : DUMMY_ACCESS_KEY ,
300
305
secretAccessKey : DUMMY_SECRET_KEY ,
@@ -331,7 +336,7 @@ describe('DownloadCenter config', function () {
331
336
tutorial_link : 'test' ,
332
337
} ) ;
333
338
334
- expect ( uploadAsset ) . to . be . calledTwice ;
339
+ expect ( uploadAsset ) . to . be . calledOnce ;
335
340
const [ assetKey ] = uploadAsset . lastCall . args ;
336
341
expect ( assetKey ) . to . equal ( 'compass/mongosh.json' ) ;
337
342
} ) ;
@@ -348,21 +353,17 @@ describe('DownloadCenter config', function () {
348
353
'' ,
349
354
false ,
350
355
DUMMY_CTA_CONFIG ,
351
- dlCenter as any ,
356
+ dlCenterConfig as any ,
357
+ dlCenterArtifacts as any ,
352
358
baseUrl
353
359
) ;
354
360
355
- expect ( dlCenter ) . to . have . been . calledWith ( {
361
+ expect ( dlCenterConfig ) . to . have . been . calledWith ( {
356
362
bucket : 'info-mongodb-com' ,
357
363
accessKeyId : DUMMY_ACCESS_KEY ,
358
364
secretAccessKey : DUMMY_SECRET_KEY ,
359
365
} ) ;
360
- expect ( dlCenter ) . to . have . been . calledWith ( {
361
- bucket : 'downloads.10gen.com' ,
362
- accessKeyId : DUMMY_ACCESS_KEY ,
363
- secretAccessKey : DUMMY_SECRET_KEY ,
364
- } ) ;
365
- expect ( dlCenter ) . to . have . been . calledWith ( {
366
+ expect ( dlCenterArtifacts ) . to . have . been . calledWith ( {
366
367
bucket : 'cdn-origin-compass' ,
367
368
accessKeyId : DUMMY_ACCESS_KEY ,
368
369
secretAccessKey : DUMMY_SECRET_KEY ,
@@ -396,7 +397,7 @@ describe('DownloadCenter config', function () {
396
397
tutorial_link : 'test' ,
397
398
} ) ;
398
399
399
- expect ( uploadAsset ) . to . be . calledTwice ;
400
+ expect ( uploadAsset ) . to . be . calledOnce ;
400
401
const [ assetKey , uploadedAsset ] = uploadAsset . lastCall . args ;
401
402
expect ( assetKey ) . to . equal ( 'compass/mongosh.json' ) ;
402
403
const jsonFeedData = JSON . parse ( uploadedAsset ) ;
@@ -463,21 +464,17 @@ describe('DownloadCenter config', function () {
463
464
) ,
464
465
false ,
465
466
DUMMY_CTA_CONFIG ,
466
- dlCenter as any ,
467
+ dlCenterConfig as any ,
468
+ dlCenterArtifacts as any ,
467
469
baseUrl
468
470
) ;
469
471
470
- expect ( dlCenter ) . to . have . been . calledWith ( {
472
+ expect ( dlCenterConfig ) . to . have . been . calledWith ( {
471
473
bucket : 'info-mongodb-com' ,
472
474
accessKeyId : DUMMY_ACCESS_KEY ,
473
475
secretAccessKey : DUMMY_SECRET_KEY ,
474
476
} ) ;
475
- expect ( dlCenter ) . to . have . been . calledWith ( {
476
- bucket : 'downloads.10gen.com' ,
477
- accessKeyId : DUMMY_ACCESS_KEY ,
478
- secretAccessKey : DUMMY_SECRET_KEY ,
479
- } ) ;
480
- expect ( dlCenter ) . to . have . been . calledWith ( {
477
+ expect ( dlCenterArtifacts ) . to . have . been . calledWith ( {
481
478
bucket : 'cdn-origin-compass' ,
482
479
accessKeyId : DUMMY_ACCESS_KEY ,
483
480
secretAccessKey : DUMMY_SECRET_KEY ,
@@ -514,7 +511,7 @@ describe('DownloadCenter config', function () {
514
511
tutorial_link : 'test' ,
515
512
} ) ;
516
513
517
- expect ( uploadAsset ) . to . be . calledTwice ;
514
+ expect ( uploadAsset ) . to . be . calledOnce ;
518
515
const [ assetKey , uploadedAsset ] = uploadAsset . lastCall . args ;
519
516
expect ( assetKey ) . to . equal ( 'compass/mongosh.json' ) ;
520
517
const jsonFeedData = JSON . parse ( uploadedAsset ) ;
@@ -621,8 +618,6 @@ describe('DownloadCenter config', function () {
621
618
config ,
622
619
DUMMY_ACCESS_KEY ,
623
620
DUMMY_SECRET_KEY ,
624
- DUMMY_ACCESS_KEY ,
625
- DUMMY_SECRET_KEY ,
626
621
DUMMY_SESSION_TOKEN ,
627
622
dryRun ,
628
623
dlCenter as any
@@ -661,8 +656,6 @@ describe('DownloadCenter config', function () {
661
656
config ,
662
657
DUMMY_ACCESS_KEY ,
663
658
DUMMY_SECRET_KEY ,
664
- DUMMY_ACCESS_KEY ,
665
- DUMMY_SECRET_KEY ,
666
659
DUMMY_SESSION_TOKEN ,
667
660
false ,
668
661
dlCenter as any
@@ -689,8 +682,6 @@ describe('DownloadCenter config', function () {
689
682
ctas ,
690
683
DUMMY_ACCESS_KEY ,
691
684
DUMMY_SECRET_KEY ,
692
- DUMMY_ACCESS_KEY ,
693
- DUMMY_SECRET_KEY ,
694
685
DUMMY_SESSION_TOKEN ,
695
686
false ,
696
687
dlCenter as any
@@ -714,8 +705,6 @@ describe('DownloadCenter config', function () {
714
705
config ,
715
706
DUMMY_ACCESS_KEY ,
716
707
DUMMY_SECRET_KEY ,
717
- DUMMY_ACCESS_KEY ,
718
- DUMMY_SECRET_KEY ,
719
708
DUMMY_SESSION_TOKEN ,
720
709
false ,
721
710
dlCenter as any
@@ -739,8 +728,6 @@ describe('DownloadCenter config', function () {
739
728
config ,
740
729
DUMMY_ACCESS_KEY ,
741
730
DUMMY_SECRET_KEY ,
742
- DUMMY_ACCESS_KEY ,
743
- DUMMY_SECRET_KEY ,
744
731
DUMMY_SESSION_TOKEN ,
745
732
false ,
746
733
dlCenter as any
@@ -764,8 +751,6 @@ describe('DownloadCenter config', function () {
764
751
config ,
765
752
DUMMY_ACCESS_KEY ,
766
753
DUMMY_SECRET_KEY ,
767
- DUMMY_ACCESS_KEY ,
768
- DUMMY_SECRET_KEY ,
769
754
DUMMY_SESSION_TOKEN ,
770
755
false ,
771
756
dlCenter as any
@@ -796,8 +781,6 @@ describe('DownloadCenter config', function () {
796
781
config ,
797
782
DUMMY_ACCESS_KEY ,
798
783
DUMMY_SECRET_KEY ,
799
- DUMMY_ACCESS_KEY ,
800
- DUMMY_SECRET_KEY ,
801
784
DUMMY_SESSION_TOKEN ,
802
785
false ,
803
786
dlCenter as any
@@ -828,8 +811,6 @@ describe('DownloadCenter config', function () {
828
811
config ,
829
812
DUMMY_ACCESS_KEY ,
830
813
DUMMY_SECRET_KEY ,
831
- DUMMY_ACCESS_KEY ,
832
- DUMMY_SECRET_KEY ,
833
814
DUMMY_SESSION_TOKEN ,
834
815
false ,
835
816
dlCenter as any
0 commit comments