@@ -53,12 +53,15 @@ suite('Linting - Linter Commands', () => {
5353 expect ( result ) . to . be . equal ( 'Hello' ) ;
5454 } ) ;
5555
56- async function testEnableLintingWithCurrentState ( currentState : boolean , selectedState : 'on' | 'off' | undefined ) {
56+ async function testEnableLintingWithCurrentState (
57+ currentState : boolean ,
58+ selectedState : 'Enable' | 'Disable' | undefined ,
59+ ) {
5760 when ( manager . isLintingEnabled ( true , anything ( ) ) ) . thenResolve ( currentState ) ;
5861 const expectedQuickPickOptions = {
5962 matchOnDetail : true ,
6063 matchOnDescription : true ,
61- placeHolder : `current: ${ currentState ? 'on ' : 'off ' } ` ,
64+ placeHolder : `current: ${ currentState ? 'Enable ' : 'Disable ' } ` ,
6265 } ;
6366 when ( shell . showQuickPick ( anything ( ) , anything ( ) ) ) . thenResolve ( selectedState as any ) ;
6467
@@ -67,29 +70,33 @@ suite('Linting - Linter Commands', () => {
6770 verify ( shell . showQuickPick ( anything ( ) , anything ( ) ) ) . once ( ) ;
6871 const options = capture ( shell . showQuickPick ) . last ( ) [ 0 ] ;
6972 const quickPickOptions = capture ( shell . showQuickPick ) . last ( ) [ 1 ] ;
70- expect ( options ) . to . deep . equal ( [ 'on ' , 'off ' ] ) ;
73+ expect ( options ) . to . deep . equal ( [ 'Enable ' , 'Disable ' ] ) ;
7174 expect ( quickPickOptions ) . to . deep . equal ( expectedQuickPickOptions ) ;
7275
7376 if ( selectedState ) {
74- verify ( manager . enableLintingAsync ( selectedState === 'on ' , anything ( ) ) ) . once ( ) ;
77+ verify ( manager . enableLintingAsync ( selectedState === 'Enable ' , anything ( ) ) ) . once ( ) ;
7578 } else {
7679 verify ( manager . enableLintingAsync ( anything ( ) , anything ( ) ) ) . never ( ) ;
7780 }
7881 }
79- test ( "Enable linting should check if linting is enabled, and display current state of 'on ' and select nothing" , async ( ) => {
82+ test ( "Enable linting should check if linting is enabled, and display current state of 'Enable ' and select nothing" , async ( ) => {
8083 await testEnableLintingWithCurrentState ( true , undefined ) ;
8184 } ) ;
82- test ( "Enable linting should check if linting is enabled, and display current state of 'on' and select 'on'" , async ( ) => {
83- await testEnableLintingWithCurrentState ( true , 'on' ) ;
85+
86+ test ( "Enable linting should check if linting is enabled, and display current state of 'Enable' and select 'Enable'" , async ( ) => {
87+ await testEnableLintingWithCurrentState ( true , 'Enable' ) ;
8488 } ) ;
85- test ( "Enable linting should check if linting is enabled, and display current state of 'on' and select 'off'" , async ( ) => {
86- await testEnableLintingWithCurrentState ( true , 'off' ) ;
89+
90+ test ( "Enable linting should check if linting is enabled, and display current state of 'Enable' and select 'Disable'" , async ( ) => {
91+ await testEnableLintingWithCurrentState ( true , 'Disable' ) ;
8792 } ) ;
88- test ( "Enable linting should check if linting is enabled, and display current state of 'off' and select 'on'" , async ( ) => {
89- await testEnableLintingWithCurrentState ( true , 'on' ) ;
93+
94+ test ( "Enable linting should check if linting is enabled, and display current state of 'Disable' and select 'Enable'" , async ( ) => {
95+ await testEnableLintingWithCurrentState ( true , 'Enable' ) ;
9096 } ) ;
91- test ( "Enable linting should check if linting is enabled, and display current state of 'off' and select 'off'" , async ( ) => {
92- await testEnableLintingWithCurrentState ( true , 'off' ) ;
97+
98+ test ( "Enable linting should check if linting is enabled, and display current state of 'Disable' and select 'Disable'" , async ( ) => {
99+ await testEnableLintingWithCurrentState ( true , 'Disable' ) ;
93100 } ) ;
94101
95102 test ( 'Set Linter should display a quickpick' , async ( ) => {
@@ -108,6 +115,7 @@ suite('Linting - Linter Commands', () => {
108115 const quickPickOptions = capture ( shell . showQuickPick ) . last ( ) [ 1 ] ;
109116 expect ( quickPickOptions ) . to . deep . equal ( expectedQuickPickOptions ) ;
110117 } ) ;
118+
111119 test ( 'Set Linter should display a quickpick and currently active linter when only one is enabled' , async ( ) => {
112120 const linterId = 'Hello World' ;
113121 const activeLinters : ILinterInfo [ ] = [ { id : linterId } as any ] ;
@@ -126,6 +134,7 @@ suite('Linting - Linter Commands', () => {
126134 const quickPickOptions = capture ( shell . showQuickPick ) . last ( ) [ 1 ] ;
127135 expect ( quickPickOptions ) . to . deep . equal ( expectedQuickPickOptions ) ;
128136 } ) ;
137+
129138 test ( 'Set Linter should display a quickpick and with message about multiple linters being enabled' , async ( ) => {
130139 const activeLinters : ILinterInfo [ ] = [ { id : 'linterId' } as any , { id : 'linterId2' } as any ] ;
131140 when ( manager . getAllLinterInfos ( ) ) . thenReturn ( [ ] ) ;
@@ -143,6 +152,7 @@ suite('Linting - Linter Commands', () => {
143152 const quickPickOptions = capture ( shell . showQuickPick ) . last ( ) [ 1 ] ;
144153 expect ( quickPickOptions ) . to . deep . equal ( expectedQuickPickOptions ) ;
145154 } ) ;
155+
146156 test ( 'Selecting a linter should display warning message about multiple linters' , async ( ) => {
147157 const linters : ILinterInfo [ ] = [ { id : '1' } , { id : '2' } , { id : '3' , product : 'Three' } ] as any ;
148158 const activeLinters : ILinterInfo [ ] = [ { id : '1' } , { id : '3' } ] as any ;
0 commit comments