@@ -9,10 +9,6 @@ const createTestInjector = (): IInjector => {
99 setCurrentUserAsOwner : async ( path : string , owner : string ) : Promise < void > => undefined
1010 } ) ;
1111
12- testInjector . register ( "subscriptionService" , {
13- subscribeForNewsletter : async ( ) : Promise < void > => undefined
14- } ) ;
15-
1612 testInjector . register ( "staticConfig" , { } ) ;
1713
1814 testInjector . register ( "commandsService" , {
@@ -57,26 +53,8 @@ describe("post-install command", () => {
5753 process . env . SUDO_USER = originalSudoUser ;
5854 } ) ;
5955
60- it ( "calls subscriptionService.subscribeForNewsletter method" , async ( ) => {
61- const testInjector = createTestInjector ( ) ;
62- const subscriptionService = testInjector . resolve < ISubscriptionService > ( "subscriptionService" ) ;
63- let isSubscribeForNewsletterCalled = false ;
64- subscriptionService . subscribeForNewsletter = async ( ) : Promise < void > => {
65- isSubscribeForNewsletterCalled = true ;
66- } ;
67- const postInstallCommand = testInjector . resolveCommand ( "post-install-cli" ) ;
68-
69- await postInstallCommand . execute ( [ ] ) ;
70- assert . isTrue ( isSubscribeForNewsletterCalled , "post-install-cli command must call subscriptionService.subscribeForNewsletter" ) ;
71- } ) ;
72-
7356 const verifyResult = async ( opts : { shouldCallMethod : boolean } ) : Promise < void > => {
7457 const testInjector = createTestInjector ( ) ;
75- const subscriptionService = testInjector . resolve < ISubscriptionService > ( "subscriptionService" ) ;
76- let isSubscribeForNewsletterCalled = false ;
77- subscriptionService . subscribeForNewsletter = async ( ) : Promise < void > => {
78- isSubscribeForNewsletterCalled = true ;
79- } ;
8058
8159 const helpService = testInjector . resolve < IHelpService > ( "helpService" ) ;
8260 let isGenerateHtmlPagesCalled = false ;
@@ -104,7 +82,6 @@ describe("post-install command", () => {
10482
10583 const hasNotInMsg = opts . shouldCallMethod ? "" : "NOT" ;
10684
107- assert . equal ( isSubscribeForNewsletterCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call subscriptionService.subscribeForNewsletter` ) ;
10885 assert . equal ( isGenerateHtmlPagesCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call helpService.generateHtmlPages` ) ;
10986 assert . equal ( isCheckConsentCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call analyticsService.checkConsent` ) ;
11087 assert . equal ( isTryExecuteCommandCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call commandsService.tryExecuteCommand` ) ;
0 commit comments