@@ -15,7 +15,7 @@ import {
1515} from '../../../client/common/application/types' ;
1616import { PersistentStateFactory } from '../../../client/common/persistentState' ;
1717import { IPlatformService } from '../../../client/common/platform/types' ;
18- import { IBrowserService , IPersistentState , IPersistentStateFactory } from '../../../client/common/types' ;
18+ import { IPersistentState , IPersistentStateFactory } from '../../../client/common/types' ;
1919import { createDeferred , createDeferredFromPromise , sleep } from '../../../client/common/utils/async' ;
2020import { Common , Interpreters } from '../../../client/common/utils/localize' ;
2121import { IInterpreterService } from '../../../client/interpreter/contracts' ;
@@ -31,7 +31,6 @@ suite('Conda Inherit Env Prompt', async () => {
3131 let appShell : TypeMoq . IMock < IApplicationShell > ;
3232 let interpreterService : TypeMoq . IMock < IInterpreterService > ;
3333 let platformService : TypeMoq . IMock < IPlatformService > ;
34- let browserService : TypeMoq . IMock < IBrowserService > ;
3534 let applicationEnvironment : TypeMoq . IMock < IApplicationEnvironment > ;
3635 let persistentStateFactory : IPersistentStateFactory ;
3736 let notificationPromptEnabled : TypeMoq . IMock < IPersistentState < any > > ;
@@ -46,7 +45,6 @@ suite('Conda Inherit Env Prompt', async () => {
4645 setup ( ( ) => {
4746 workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
4847 appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
49- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
5048 interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
5149 persistentStateFactory = mock ( PersistentStateFactory ) ;
5250 platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
@@ -55,10 +53,8 @@ suite('Conda Inherit Env Prompt', async () => {
5553 condaInheritEnvPrompt = new CondaInheritEnvPrompt (
5654 interpreterService . object ,
5755 workspaceService . object ,
58- browserService . object ,
5956 appShell . object ,
6057 instance ( persistentStateFactory ) ,
61-
6258 platformService . object ,
6359 applicationEnvironment . object ,
6460 ) ;
@@ -67,10 +63,8 @@ suite('Conda Inherit Env Prompt', async () => {
6763 condaInheritEnvPrompt = new CondaInheritEnvPrompt (
6864 interpreterService . object ,
6965 workspaceService . object ,
70- browserService . object ,
7166 appShell . object ,
7267 instance ( persistentStateFactory ) ,
73-
7468 platformService . object ,
7569 applicationEnvironment . object ,
7670 true ,
@@ -260,7 +254,6 @@ suite('Conda Inherit Env Prompt', async () => {
260254 setup ( ( ) => {
261255 workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
262256 appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
263- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
264257 interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
265258 persistentStateFactory = mock ( PersistentStateFactory ) ;
266259 platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
@@ -279,7 +272,6 @@ suite('Conda Inherit Env Prompt', async () => {
279272 condaInheritEnvPrompt = new CondaInheritEnvPrompt (
280273 interpreterService . object ,
281274 workspaceService . object ,
282- browserService . object ,
283275 appShell . object ,
284276 instance ( persistentStateFactory ) ,
285277
@@ -305,7 +297,6 @@ suite('Conda Inherit Env Prompt', async () => {
305297 condaInheritEnvPrompt = new CondaInheritEnvPrompt (
306298 interpreterService . object ,
307299 workspaceService . object ,
308- browserService . object ,
309300 appShell . object ,
310301 instance ( persistentStateFactory ) ,
311302
@@ -323,7 +314,6 @@ suite('Conda Inherit Env Prompt', async () => {
323314 setup ( ( ) => {
324315 workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
325316 appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
326- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
327317 interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
328318 persistentStateFactory = mock ( PersistentStateFactory ) ;
329319 platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
@@ -343,7 +333,6 @@ suite('Conda Inherit Env Prompt', async () => {
343333 condaInheritEnvPrompt = new CondaInheritEnvPrompt (
344334 interpreterService . object ,
345335 workspaceService . object ,
346- browserService . object ,
347336 appShell . object ,
348337 instance ( persistentStateFactory ) ,
349338
@@ -363,7 +352,6 @@ suite('Conda Inherit Env Prompt', async () => {
363352 condaInheritEnvPrompt = new CondaInheritEnvPrompt (
364353 interpreterService . object ,
365354 workspaceService . object ,
366- browserService . object ,
367355 appShell . object ,
368356 instance ( persistentStateFactory ) ,
369357
@@ -377,13 +365,12 @@ suite('Conda Inherit Env Prompt', async () => {
377365 } ) ;
378366
379367 suite ( 'Method promptAndUpdate()' , ( ) => {
380- const prompts = [ Common . bannerLabelYes , Common . bannerLabelNo , Common . moreInfo ] ;
368+ const prompts = [ Common . allow , Common . close ] ;
381369 setup ( ( ) => {
382370 workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
383371 appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
384372 interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
385373 persistentStateFactory = mock ( PersistentStateFactory ) ;
386- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
387374 notificationPromptEnabled = TypeMoq . Mock . ofType < IPersistentState < any > > ( ) ;
388375 platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
389376 applicationEnvironment = TypeMoq . Mock . ofType < IApplicationEnvironment > ( ) ;
@@ -394,7 +381,6 @@ suite('Conda Inherit Env Prompt', async () => {
394381 condaInheritEnvPrompt = new CondaInheritEnvPrompt (
395382 interpreterService . object ,
396383 workspaceService . object ,
397- browserService . object ,
398384 appShell . object ,
399385 instance ( persistentStateFactory ) ,
400386
@@ -439,16 +425,11 @@ suite('Conda Inherit Env Prompt', async () => {
439425 . setup ( ( n ) => n . updateValue ( false ) )
440426 . returns ( ( ) => Promise . resolve ( undefined ) )
441427 . verifiable ( TypeMoq . Times . never ( ) ) ;
442- browserService
443- . setup ( ( b ) => b . launch ( 'https://aka.ms/AA66i8f' ) )
444- . returns ( ( ) => undefined )
445- . verifiable ( TypeMoq . Times . never ( ) ) ;
446428 await condaInheritEnvPrompt . promptAndUpdate ( ) ;
447429 verify ( persistentStateFactory . createGlobalPersistentState ( condaInheritEnvPromptKey , true ) ) . once ( ) ;
448430 verifyAll ( ) ;
449431 workspaceConfig . verifyAll ( ) ;
450432 notificationPromptEnabled . verifyAll ( ) ;
451- browserService . verifyAll ( ) ;
452433 } ) ;
453434 test ( 'Update terminal settings if `Yes` is selected' , async ( ) => {
454435 const workspaceConfig = TypeMoq . Mock . ofType < WorkspaceConfiguration > ( ) ;
@@ -458,7 +439,7 @@ suite('Conda Inherit Env Prompt', async () => {
458439 . verifiable ( TypeMoq . Times . once ( ) ) ;
459440 appShell
460441 . setup ( ( a ) => a . showInformationMessage ( Interpreters . condaInheritEnvMessage , ...prompts ) )
461- . returns ( ( ) => Promise . resolve ( Common . bannerLabelYes ) )
442+ . returns ( ( ) => Promise . resolve ( Common . allow ) )
462443 . verifiable ( TypeMoq . Times . once ( ) ) ;
463444 workspaceService
464445 . setup ( ( ws ) => ws . getConfiguration ( 'terminal' ) )
@@ -472,16 +453,11 @@ suite('Conda Inherit Env Prompt', async () => {
472453 . setup ( ( n ) => n . updateValue ( false ) )
473454 . returns ( ( ) => Promise . resolve ( undefined ) )
474455 . verifiable ( TypeMoq . Times . never ( ) ) ;
475- browserService
476- . setup ( ( b ) => b . launch ( 'https://aka.ms/AA66i8f' ) )
477- . returns ( ( ) => undefined )
478- . verifiable ( TypeMoq . Times . never ( ) ) ;
479456 await condaInheritEnvPrompt . promptAndUpdate ( ) ;
480457 verify ( persistentStateFactory . createGlobalPersistentState ( condaInheritEnvPromptKey , true ) ) . once ( ) ;
481458 verifyAll ( ) ;
482459 workspaceConfig . verifyAll ( ) ;
483460 notificationPromptEnabled . verifyAll ( ) ;
484- browserService . verifyAll ( ) ;
485461 } ) ;
486462 test ( 'Disable notification prompt if `No` is selected' , async ( ) => {
487463 const workspaceConfig = TypeMoq . Mock . ofType < WorkspaceConfiguration > ( ) ;
@@ -491,40 +467,7 @@ suite('Conda Inherit Env Prompt', async () => {
491467 . verifiable ( TypeMoq . Times . once ( ) ) ;
492468 appShell
493469 . setup ( ( a ) => a . showInformationMessage ( Interpreters . condaInheritEnvMessage , ...prompts ) )
494- . returns ( ( ) => Promise . resolve ( Common . bannerLabelNo ) )
495- . verifiable ( TypeMoq . Times . once ( ) ) ;
496- workspaceService
497- . setup ( ( ws ) => ws . getConfiguration ( 'terminal' ) )
498- . returns ( ( ) => workspaceConfig . object )
499- . verifiable ( TypeMoq . Times . never ( ) ) ;
500- workspaceConfig
501- . setup ( ( wc ) => wc . update ( 'integrated.inheritEnv' , false , ConfigurationTarget . Global ) )
502- . returns ( ( ) => Promise . resolve ( ) )
503- . verifiable ( TypeMoq . Times . never ( ) ) ;
504- notificationPromptEnabled
505- . setup ( ( n ) => n . updateValue ( false ) )
506- . returns ( ( ) => Promise . resolve ( undefined ) )
507- . verifiable ( TypeMoq . Times . once ( ) ) ;
508- browserService
509- . setup ( ( b ) => b . launch ( 'https://aka.ms/AA66i8f' ) )
510- . returns ( ( ) => undefined )
511- . verifiable ( TypeMoq . Times . never ( ) ) ;
512- await condaInheritEnvPrompt . promptAndUpdate ( ) ;
513- verify ( persistentStateFactory . createGlobalPersistentState ( condaInheritEnvPromptKey , true ) ) . once ( ) ;
514- verifyAll ( ) ;
515- workspaceConfig . verifyAll ( ) ;
516- notificationPromptEnabled . verifyAll ( ) ;
517- browserService . verifyAll ( ) ;
518- } ) ;
519- test ( 'Launch browser if `More info` option is selected' , async ( ) => {
520- const workspaceConfig = TypeMoq . Mock . ofType < WorkspaceConfiguration > ( ) ;
521- notificationPromptEnabled
522- . setup ( ( n ) => n . value )
523- . returns ( ( ) => true )
524- . verifiable ( TypeMoq . Times . once ( ) ) ;
525- appShell
526- . setup ( ( a ) => a . showInformationMessage ( Interpreters . condaInheritEnvMessage , ...prompts ) )
527- . returns ( ( ) => Promise . resolve ( Common . moreInfo ) )
470+ . returns ( ( ) => Promise . resolve ( Common . close ) )
528471 . verifiable ( TypeMoq . Times . once ( ) ) ;
529472 workspaceService
530473 . setup ( ( ws ) => ws . getConfiguration ( 'terminal' ) )
@@ -537,17 +480,12 @@ suite('Conda Inherit Env Prompt', async () => {
537480 notificationPromptEnabled
538481 . setup ( ( n ) => n . updateValue ( false ) )
539482 . returns ( ( ) => Promise . resolve ( undefined ) )
540- . verifiable ( TypeMoq . Times . never ( ) ) ;
541- browserService
542- . setup ( ( b ) => b . launch ( 'https://aka.ms/AA66i8f' ) )
543- . returns ( ( ) => undefined )
544483 . verifiable ( TypeMoq . Times . once ( ) ) ;
545484 await condaInheritEnvPrompt . promptAndUpdate ( ) ;
546485 verify ( persistentStateFactory . createGlobalPersistentState ( condaInheritEnvPromptKey , true ) ) . once ( ) ;
547486 verifyAll ( ) ;
548487 workspaceConfig . verifyAll ( ) ;
549488 notificationPromptEnabled . verifyAll ( ) ;
550- browserService . verifyAll ( ) ;
551489 } ) ;
552490 } ) ;
553491} ) ;
0 commit comments