@@ -15,7 +15,7 @@ import {
15
15
} from '../../../client/common/application/types' ;
16
16
import { PersistentStateFactory } from '../../../client/common/persistentState' ;
17
17
import { IPlatformService } from '../../../client/common/platform/types' ;
18
- import { IBrowserService , IPersistentState , IPersistentStateFactory } from '../../../client/common/types' ;
18
+ import { IPersistentState , IPersistentStateFactory } from '../../../client/common/types' ;
19
19
import { createDeferred , createDeferredFromPromise , sleep } from '../../../client/common/utils/async' ;
20
20
import { Common , Interpreters } from '../../../client/common/utils/localize' ;
21
21
import { IInterpreterService } from '../../../client/interpreter/contracts' ;
@@ -31,7 +31,6 @@ suite('Conda Inherit Env Prompt', async () => {
31
31
let appShell : TypeMoq . IMock < IApplicationShell > ;
32
32
let interpreterService : TypeMoq . IMock < IInterpreterService > ;
33
33
let platformService : TypeMoq . IMock < IPlatformService > ;
34
- let browserService : TypeMoq . IMock < IBrowserService > ;
35
34
let applicationEnvironment : TypeMoq . IMock < IApplicationEnvironment > ;
36
35
let persistentStateFactory : IPersistentStateFactory ;
37
36
let notificationPromptEnabled : TypeMoq . IMock < IPersistentState < any > > ;
@@ -46,7 +45,6 @@ suite('Conda Inherit Env Prompt', async () => {
46
45
setup ( ( ) => {
47
46
workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
48
47
appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
49
- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
50
48
interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
51
49
persistentStateFactory = mock ( PersistentStateFactory ) ;
52
50
platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
@@ -55,10 +53,8 @@ suite('Conda Inherit Env Prompt', async () => {
55
53
condaInheritEnvPrompt = new CondaInheritEnvPrompt (
56
54
interpreterService . object ,
57
55
workspaceService . object ,
58
- browserService . object ,
59
56
appShell . object ,
60
57
instance ( persistentStateFactory ) ,
61
-
62
58
platformService . object ,
63
59
applicationEnvironment . object ,
64
60
) ;
@@ -67,10 +63,8 @@ suite('Conda Inherit Env Prompt', async () => {
67
63
condaInheritEnvPrompt = new CondaInheritEnvPrompt (
68
64
interpreterService . object ,
69
65
workspaceService . object ,
70
- browserService . object ,
71
66
appShell . object ,
72
67
instance ( persistentStateFactory ) ,
73
-
74
68
platformService . object ,
75
69
applicationEnvironment . object ,
76
70
true ,
@@ -260,7 +254,6 @@ suite('Conda Inherit Env Prompt', async () => {
260
254
setup ( ( ) => {
261
255
workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
262
256
appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
263
- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
264
257
interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
265
258
persistentStateFactory = mock ( PersistentStateFactory ) ;
266
259
platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
@@ -279,7 +272,6 @@ suite('Conda Inherit Env Prompt', async () => {
279
272
condaInheritEnvPrompt = new CondaInheritEnvPrompt (
280
273
interpreterService . object ,
281
274
workspaceService . object ,
282
- browserService . object ,
283
275
appShell . object ,
284
276
instance ( persistentStateFactory ) ,
285
277
@@ -305,7 +297,6 @@ suite('Conda Inherit Env Prompt', async () => {
305
297
condaInheritEnvPrompt = new CondaInheritEnvPrompt (
306
298
interpreterService . object ,
307
299
workspaceService . object ,
308
- browserService . object ,
309
300
appShell . object ,
310
301
instance ( persistentStateFactory ) ,
311
302
@@ -323,7 +314,6 @@ suite('Conda Inherit Env Prompt', async () => {
323
314
setup ( ( ) => {
324
315
workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
325
316
appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
326
- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
327
317
interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
328
318
persistentStateFactory = mock ( PersistentStateFactory ) ;
329
319
platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
@@ -343,7 +333,6 @@ suite('Conda Inherit Env Prompt', async () => {
343
333
condaInheritEnvPrompt = new CondaInheritEnvPrompt (
344
334
interpreterService . object ,
345
335
workspaceService . object ,
346
- browserService . object ,
347
336
appShell . object ,
348
337
instance ( persistentStateFactory ) ,
349
338
@@ -363,7 +352,6 @@ suite('Conda Inherit Env Prompt', async () => {
363
352
condaInheritEnvPrompt = new CondaInheritEnvPrompt (
364
353
interpreterService . object ,
365
354
workspaceService . object ,
366
- browserService . object ,
367
355
appShell . object ,
368
356
instance ( persistentStateFactory ) ,
369
357
@@ -377,13 +365,12 @@ suite('Conda Inherit Env Prompt', async () => {
377
365
} ) ;
378
366
379
367
suite ( 'Method promptAndUpdate()' , ( ) => {
380
- const prompts = [ Common . bannerLabelYes , Common . bannerLabelNo , Common . moreInfo ] ;
368
+ const prompts = [ Common . allow , Common . close ] ;
381
369
setup ( ( ) => {
382
370
workspaceService = TypeMoq . Mock . ofType < IWorkspaceService > ( ) ;
383
371
appShell = TypeMoq . Mock . ofType < IApplicationShell > ( ) ;
384
372
interpreterService = TypeMoq . Mock . ofType < IInterpreterService > ( ) ;
385
373
persistentStateFactory = mock ( PersistentStateFactory ) ;
386
- browserService = TypeMoq . Mock . ofType < IBrowserService > ( ) ;
387
374
notificationPromptEnabled = TypeMoq . Mock . ofType < IPersistentState < any > > ( ) ;
388
375
platformService = TypeMoq . Mock . ofType < IPlatformService > ( ) ;
389
376
applicationEnvironment = TypeMoq . Mock . ofType < IApplicationEnvironment > ( ) ;
@@ -394,7 +381,6 @@ suite('Conda Inherit Env Prompt', async () => {
394
381
condaInheritEnvPrompt = new CondaInheritEnvPrompt (
395
382
interpreterService . object ,
396
383
workspaceService . object ,
397
- browserService . object ,
398
384
appShell . object ,
399
385
instance ( persistentStateFactory ) ,
400
386
@@ -439,16 +425,11 @@ suite('Conda Inherit Env Prompt', async () => {
439
425
. setup ( ( n ) => n . updateValue ( false ) )
440
426
. returns ( ( ) => Promise . resolve ( undefined ) )
441
427
. verifiable ( TypeMoq . Times . never ( ) ) ;
442
- browserService
443
- . setup ( ( b ) => b . launch ( 'https://aka.ms/AA66i8f' ) )
444
- . returns ( ( ) => undefined )
445
- . verifiable ( TypeMoq . Times . never ( ) ) ;
446
428
await condaInheritEnvPrompt . promptAndUpdate ( ) ;
447
429
verify ( persistentStateFactory . createGlobalPersistentState ( condaInheritEnvPromptKey , true ) ) . once ( ) ;
448
430
verifyAll ( ) ;
449
431
workspaceConfig . verifyAll ( ) ;
450
432
notificationPromptEnabled . verifyAll ( ) ;
451
- browserService . verifyAll ( ) ;
452
433
} ) ;
453
434
test ( 'Update terminal settings if `Yes` is selected' , async ( ) => {
454
435
const workspaceConfig = TypeMoq . Mock . ofType < WorkspaceConfiguration > ( ) ;
@@ -458,7 +439,7 @@ suite('Conda Inherit Env Prompt', async () => {
458
439
. verifiable ( TypeMoq . Times . once ( ) ) ;
459
440
appShell
460
441
. setup ( ( a ) => a . showInformationMessage ( Interpreters . condaInheritEnvMessage , ...prompts ) )
461
- . returns ( ( ) => Promise . resolve ( Common . bannerLabelYes ) )
442
+ . returns ( ( ) => Promise . resolve ( Common . allow ) )
462
443
. verifiable ( TypeMoq . Times . once ( ) ) ;
463
444
workspaceService
464
445
. setup ( ( ws ) => ws . getConfiguration ( 'terminal' ) )
@@ -472,16 +453,11 @@ suite('Conda Inherit Env Prompt', async () => {
472
453
. setup ( ( n ) => n . updateValue ( false ) )
473
454
. returns ( ( ) => Promise . resolve ( undefined ) )
474
455
. verifiable ( TypeMoq . Times . never ( ) ) ;
475
- browserService
476
- . setup ( ( b ) => b . launch ( 'https://aka.ms/AA66i8f' ) )
477
- . returns ( ( ) => undefined )
478
- . verifiable ( TypeMoq . Times . never ( ) ) ;
479
456
await condaInheritEnvPrompt . promptAndUpdate ( ) ;
480
457
verify ( persistentStateFactory . createGlobalPersistentState ( condaInheritEnvPromptKey , true ) ) . once ( ) ;
481
458
verifyAll ( ) ;
482
459
workspaceConfig . verifyAll ( ) ;
483
460
notificationPromptEnabled . verifyAll ( ) ;
484
- browserService . verifyAll ( ) ;
485
461
} ) ;
486
462
test ( 'Disable notification prompt if `No` is selected' , async ( ) => {
487
463
const workspaceConfig = TypeMoq . Mock . ofType < WorkspaceConfiguration > ( ) ;
@@ -491,40 +467,7 @@ suite('Conda Inherit Env Prompt', async () => {
491
467
. verifiable ( TypeMoq . Times . once ( ) ) ;
492
468
appShell
493
469
. 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 ) )
528
471
. verifiable ( TypeMoq . Times . once ( ) ) ;
529
472
workspaceService
530
473
. setup ( ( ws ) => ws . getConfiguration ( 'terminal' ) )
@@ -537,17 +480,12 @@ suite('Conda Inherit Env Prompt', async () => {
537
480
notificationPromptEnabled
538
481
. setup ( ( n ) => n . updateValue ( false ) )
539
482
. returns ( ( ) => Promise . resolve ( undefined ) )
540
- . verifiable ( TypeMoq . Times . never ( ) ) ;
541
- browserService
542
- . setup ( ( b ) => b . launch ( 'https://aka.ms/AA66i8f' ) )
543
- . returns ( ( ) => undefined )
544
483
. verifiable ( TypeMoq . Times . once ( ) ) ;
545
484
await condaInheritEnvPrompt . promptAndUpdate ( ) ;
546
485
verify ( persistentStateFactory . createGlobalPersistentState ( condaInheritEnvPromptKey , true ) ) . once ( ) ;
547
486
verifyAll ( ) ;
548
487
workspaceConfig . verifyAll ( ) ;
549
488
notificationPromptEnabled . verifyAll ( ) ;
550
- browserService . verifyAll ( ) ;
551
489
} ) ;
552
490
} ) ;
553
491
} ) ;
0 commit comments