@@ -242,7 +242,8 @@ describe('DownloadCenter config', function () {
242242 } ) ;
243243
244244 describe ( 'createAndPublishDownloadCenterConfig' , function ( ) {
245- let dlCenter : sinon . SinonStub ;
245+ let dlCenterConfig : sinon . SinonStub ;
246+ let dlCenterArtifacts : sinon . SinonStub ;
246247 let uploadConfig : sinon . SinonStub ;
247248 let downloadConfig : sinon . SinonStub ;
248249 let uploadAsset : sinon . SinonStub ;
@@ -254,9 +255,17 @@ describe('DownloadCenter config', function () {
254255 downloadConfig = sinon . stub ( ) ;
255256 uploadAsset = sinon . stub ( ) ;
256257 downloadAsset = sinon . stub ( ) ;
257- dlCenter = sinon . stub ( ) ;
258+ dlCenterConfig = sinon . stub ( ) ;
259+ dlCenterArtifacts = sinon . stub ( ) ;
258260
259- dlCenter . returns ( {
261+ dlCenterConfig . returns ( {
262+ downloadConfig,
263+ uploadConfig,
264+ uploadAsset,
265+ downloadAsset,
266+ } ) ;
267+
268+ dlCenterArtifacts . returns ( {
260269 downloadConfig,
261270 uploadConfig,
262271 uploadAsset,
@@ -280,21 +289,17 @@ describe('DownloadCenter config', function () {
280289 '' ,
281290 false ,
282291 DUMMY_CTA_CONFIG ,
283- dlCenter as any ,
292+ dlCenterConfig as any ,
293+ dlCenterArtifacts as any ,
284294 baseUrl
285295 ) ;
286296
287- expect ( dlCenter ) . to . have . been . calledWith ( {
297+ expect ( dlCenterConfig ) . to . have . been . calledWith ( {
288298 bucket : 'info-mongodb-com' ,
289299 accessKeyId : DUMMY_ACCESS_KEY ,
290300 secretAccessKey : DUMMY_SECRET_KEY ,
291301 } ) ;
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 ( {
298303 bucket : 'cdn-origin-compass' ,
299304 accessKeyId : DUMMY_ACCESS_KEY ,
300305 secretAccessKey : DUMMY_SECRET_KEY ,
@@ -331,7 +336,7 @@ describe('DownloadCenter config', function () {
331336 tutorial_link : 'test' ,
332337 } ) ;
333338
334- expect ( uploadAsset ) . to . be . calledTwice ;
339+ expect ( uploadAsset ) . to . be . calledOnce ;
335340 const [ assetKey ] = uploadAsset . lastCall . args ;
336341 expect ( assetKey ) . to . equal ( 'compass/mongosh.json' ) ;
337342 } ) ;
@@ -348,21 +353,17 @@ describe('DownloadCenter config', function () {
348353 '' ,
349354 false ,
350355 DUMMY_CTA_CONFIG ,
351- dlCenter as any ,
356+ dlCenterConfig as any ,
357+ dlCenterArtifacts as any ,
352358 baseUrl
353359 ) ;
354360
355- expect ( dlCenter ) . to . have . been . calledWith ( {
361+ expect ( dlCenterConfig ) . to . have . been . calledWith ( {
356362 bucket : 'info-mongodb-com' ,
357363 accessKeyId : DUMMY_ACCESS_KEY ,
358364 secretAccessKey : DUMMY_SECRET_KEY ,
359365 } ) ;
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 ( {
366367 bucket : 'cdn-origin-compass' ,
367368 accessKeyId : DUMMY_ACCESS_KEY ,
368369 secretAccessKey : DUMMY_SECRET_KEY ,
@@ -396,7 +397,7 @@ describe('DownloadCenter config', function () {
396397 tutorial_link : 'test' ,
397398 } ) ;
398399
399- expect ( uploadAsset ) . to . be . calledTwice ;
400+ expect ( uploadAsset ) . to . be . calledOnce ;
400401 const [ assetKey , uploadedAsset ] = uploadAsset . lastCall . args ;
401402 expect ( assetKey ) . to . equal ( 'compass/mongosh.json' ) ;
402403 const jsonFeedData = JSON . parse ( uploadedAsset ) ;
@@ -463,21 +464,17 @@ describe('DownloadCenter config', function () {
463464 ) ,
464465 false ,
465466 DUMMY_CTA_CONFIG ,
466- dlCenter as any ,
467+ dlCenterConfig as any ,
468+ dlCenterArtifacts as any ,
467469 baseUrl
468470 ) ;
469471
470- expect ( dlCenter ) . to . have . been . calledWith ( {
472+ expect ( dlCenterConfig ) . to . have . been . calledWith ( {
471473 bucket : 'info-mongodb-com' ,
472474 accessKeyId : DUMMY_ACCESS_KEY ,
473475 secretAccessKey : DUMMY_SECRET_KEY ,
474476 } ) ;
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 ( {
481478 bucket : 'cdn-origin-compass' ,
482479 accessKeyId : DUMMY_ACCESS_KEY ,
483480 secretAccessKey : DUMMY_SECRET_KEY ,
@@ -514,7 +511,7 @@ describe('DownloadCenter config', function () {
514511 tutorial_link : 'test' ,
515512 } ) ;
516513
517- expect ( uploadAsset ) . to . be . calledTwice ;
514+ expect ( uploadAsset ) . to . be . calledOnce ;
518515 const [ assetKey , uploadedAsset ] = uploadAsset . lastCall . args ;
519516 expect ( assetKey ) . to . equal ( 'compass/mongosh.json' ) ;
520517 const jsonFeedData = JSON . parse ( uploadedAsset ) ;
@@ -621,8 +618,6 @@ describe('DownloadCenter config', function () {
621618 config ,
622619 DUMMY_ACCESS_KEY ,
623620 DUMMY_SECRET_KEY ,
624- DUMMY_ACCESS_KEY ,
625- DUMMY_SECRET_KEY ,
626621 DUMMY_SESSION_TOKEN ,
627622 dryRun ,
628623 dlCenter as any
@@ -661,8 +656,6 @@ describe('DownloadCenter config', function () {
661656 config ,
662657 DUMMY_ACCESS_KEY ,
663658 DUMMY_SECRET_KEY ,
664- DUMMY_ACCESS_KEY ,
665- DUMMY_SECRET_KEY ,
666659 DUMMY_SESSION_TOKEN ,
667660 false ,
668661 dlCenter as any
@@ -689,8 +682,6 @@ describe('DownloadCenter config', function () {
689682 ctas ,
690683 DUMMY_ACCESS_KEY ,
691684 DUMMY_SECRET_KEY ,
692- DUMMY_ACCESS_KEY ,
693- DUMMY_SECRET_KEY ,
694685 DUMMY_SESSION_TOKEN ,
695686 false ,
696687 dlCenter as any
@@ -714,8 +705,6 @@ describe('DownloadCenter config', function () {
714705 config ,
715706 DUMMY_ACCESS_KEY ,
716707 DUMMY_SECRET_KEY ,
717- DUMMY_ACCESS_KEY ,
718- DUMMY_SECRET_KEY ,
719708 DUMMY_SESSION_TOKEN ,
720709 false ,
721710 dlCenter as any
@@ -739,8 +728,6 @@ describe('DownloadCenter config', function () {
739728 config ,
740729 DUMMY_ACCESS_KEY ,
741730 DUMMY_SECRET_KEY ,
742- DUMMY_ACCESS_KEY ,
743- DUMMY_SECRET_KEY ,
744731 DUMMY_SESSION_TOKEN ,
745732 false ,
746733 dlCenter as any
@@ -764,8 +751,6 @@ describe('DownloadCenter config', function () {
764751 config ,
765752 DUMMY_ACCESS_KEY ,
766753 DUMMY_SECRET_KEY ,
767- DUMMY_ACCESS_KEY ,
768- DUMMY_SECRET_KEY ,
769754 DUMMY_SESSION_TOKEN ,
770755 false ,
771756 dlCenter as any
@@ -796,8 +781,6 @@ describe('DownloadCenter config', function () {
796781 config ,
797782 DUMMY_ACCESS_KEY ,
798783 DUMMY_SECRET_KEY ,
799- DUMMY_ACCESS_KEY ,
800- DUMMY_SECRET_KEY ,
801784 DUMMY_SESSION_TOKEN ,
802785 false ,
803786 dlCenter as any
@@ -828,8 +811,6 @@ describe('DownloadCenter config', function () {
828811 config ,
829812 DUMMY_ACCESS_KEY ,
830813 DUMMY_SECRET_KEY ,
831- DUMMY_ACCESS_KEY ,
832- DUMMY_SECRET_KEY ,
833814 DUMMY_SESSION_TOKEN ,
834815 false ,
835816 dlCenter as any
0 commit comments