@@ -9,10 +9,6 @@ const createTestInjector = (): IInjector => {
9
9
setCurrentUserAsOwner : async ( path : string , owner : string ) : Promise < void > => undefined
10
10
} ) ;
11
11
12
- testInjector . register ( "subscriptionService" , {
13
- subscribeForNewsletter : async ( ) : Promise < void > => undefined
14
- } ) ;
15
-
16
12
testInjector . register ( "staticConfig" , { } ) ;
17
13
18
14
testInjector . register ( "commandsService" , {
@@ -57,26 +53,8 @@ describe("post-install command", () => {
57
53
process . env . SUDO_USER = originalSudoUser ;
58
54
} ) ;
59
55
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
-
73
56
const verifyResult = async ( opts : { shouldCallMethod : boolean } ) : Promise < void > => {
74
57
const testInjector = createTestInjector ( ) ;
75
- const subscriptionService = testInjector . resolve < ISubscriptionService > ( "subscriptionService" ) ;
76
- let isSubscribeForNewsletterCalled = false ;
77
- subscriptionService . subscribeForNewsletter = async ( ) : Promise < void > => {
78
- isSubscribeForNewsletterCalled = true ;
79
- } ;
80
58
81
59
const helpService = testInjector . resolve < IHelpService > ( "helpService" ) ;
82
60
let isGenerateHtmlPagesCalled = false ;
@@ -104,7 +82,6 @@ describe("post-install command", () => {
104
82
105
83
const hasNotInMsg = opts . shouldCallMethod ? "" : "NOT" ;
106
84
107
- assert . equal ( isSubscribeForNewsletterCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call subscriptionService.subscribeForNewsletter` ) ;
108
85
assert . equal ( isGenerateHtmlPagesCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call helpService.generateHtmlPages` ) ;
109
86
assert . equal ( isCheckConsentCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call analyticsService.checkConsent` ) ;
110
87
assert . equal ( isTryExecuteCommandCalled , opts . shouldCallMethod , `post-install-cli command must ${ hasNotInMsg } call commandsService.tryExecuteCommand` ) ;
0 commit comments