diff --git a/spec/cli.spec.js b/spec/cli.spec.js index 59e8a91e6..ba47f3e86 100644 --- a/spec/cli.spec.js +++ b/spec/cli.spec.js @@ -292,37 +292,10 @@ describe('cordova cli', () => { }); }); - it('Test#028 : opts-out if prompt times out AND it tracks opt-out', () => { - // Remove any optOut settings that might have been saved - // ... and force prompt to be shown - telemetry.clear(); - - // We override telemetry timeout here so we don't need to wait - // 30 seconds. 0s is impossible with the current implementation. - telemetry.timeoutInSecs = 0.01; - - // Don't display the prompt - spyOn(process.stdout, 'write'); - - telemetry.isOptedIn.and.callThrough(); - telemetry.showPrompt.and.callThrough(); - telemetry.hasUserOptedInOrOut.and.returnValue(false); - - return cli(['node', 'cordova', '--version']).then(() => { - if (process.env.CI) { - expect(telemetry.isOptedIn()).toBeTruthy(); - } else { - expect(telemetry.isOptedIn()).toBeFalsy(); - } - expect(telemetry.track).toHaveBeenCalledWith('telemetry', 'off', 'via-cli-prompt-choice', 'successful'); - }); - }); - - it("Test#029 : is NOT collected in CI environments and doesn't prompt", () => { + it('Test#029 : is NOT collected in CI environments', () => { telemetry.isCI.and.returnValue(true); return cli(['node', 'cordova', '--version']).then(() => { - expect(telemetry.showPrompt).not.toHaveBeenCalled(); expect(telemetry.track).not.toHaveBeenCalled(); }); }); @@ -336,23 +309,6 @@ describe('cordova cli', () => { }); }); - it('Test#031 : is NOT collected if user opted out', () => { - telemetry.isOptedIn.and.returnValue(false); - telemetry.hasUserOptedInOrOut.and.returnValue(true); - - return cli(['node', 'cordova', '--version']).then(() => { - expect(telemetry.showPrompt).not.toHaveBeenCalled(); - expect(telemetry.track).not.toHaveBeenCalled(); - }); - }); - - it('Test#032 : is collected if user opted in', () => { - return cli(['node', 'cordova', '--version']).then(() => { - expect(telemetry.showPrompt).not.toHaveBeenCalled(); - expect(telemetry.track).toHaveBeenCalled(); - }); - }); - it("Test#033 : track opt-out that happened via 'cordova telemetry off' even if user is NOT opted-in ", () => { telemetry.isOptedIn.and.returnValue(false);