@@ -193,36 +193,36 @@ describe('CodeWhisperer-basicCommands', function () {
193193 codeScansState = new TestCodeScansState ( )
194194 } )
195195
196- it ( 'has auto scans enabled by default' , async function ( ) {
196+ it ( 'has auto scans disabled by default' , async function ( ) {
197197 targetCommand = testCommand ( toggleCodeScans , codeScansState )
198- assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
198+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
199199 } )
200200
201201 it ( 'toggles states as expected' , async function ( ) {
202202 targetCommand = testCommand ( toggleCodeScans , codeScansState )
203- assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
204- await targetCommand . execute ( placeholder , cwQuickPickSource )
205203 assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
206204 await targetCommand . execute ( placeholder , cwQuickPickSource )
207205 assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
208206 await targetCommand . execute ( placeholder , cwQuickPickSource )
209207 assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
208+ await targetCommand . execute ( placeholder , cwQuickPickSource )
209+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
210210 } )
211211
212212 it ( 'setScansEnabled() works as expected' , async function ( ) {
213- // initially true
214- assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
215-
216- await codeScansState . setScansEnabled ( false )
213+ // initially false
217214 assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
218215
219- // set new state to current state
220- await codeScansState . setScansEnabled ( false )
221- assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
216+ await codeScansState . setScansEnabled ( true )
217+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
222218
223- // set to opposite state
219+ // set new state to current state
224220 await codeScansState . setScansEnabled ( true )
225221 assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
222+
223+ // set to opposite state
224+ await codeScansState . setScansEnabled ( false )
225+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
226226 } )
227227
228228 it ( 'triggers event listener when toggled' , async function ( ) {
@@ -239,28 +239,28 @@ describe('CodeWhisperer-basicCommands', function () {
239239 assert . strictEqual ( eventListener . callCount , 1 )
240240 } )
241241
242- it ( 'emits aws_modifySetting event on user toggling autoScans - deactivate ' , async function ( ) {
242+ it ( 'emits aws_modifySetting event on user toggling autoScans - activate ' , async function ( ) {
243243 targetCommand = testCommand ( toggleCodeScans , codeScansState )
244244 await targetCommand . execute ( placeholder , cwQuickPickSource )
245245
246- assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
246+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
247247 assertTelemetryCurried ( 'aws_modifySetting' ) ( {
248248 settingId : CodeWhispererConstants . autoScansConfig . settingId ,
249- settingState : CodeWhispererConstants . autoScansConfig . deactivated ,
249+ settingState : CodeWhispererConstants . autoScansConfig . activated ,
250250 } )
251251 } )
252252
253- it ( 'emits aws_modifySetting event on user toggling autoScans -- activate ' , async function ( ) {
254- codeScansState = new TestCodeScansState ( false )
255- assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
253+ it ( 'emits aws_modifySetting event on user toggling autoScans -- deactivate ' , async function ( ) {
254+ codeScansState = new TestCodeScansState ( true )
255+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
256256
257257 targetCommand = testCommand ( toggleCodeScans , codeScansState )
258258 await targetCommand . execute ( placeholder , cwQuickPickSource )
259259
260- assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
260+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
261261 assertTelemetryCurried ( 'aws_modifySetting' ) ( {
262262 settingId : CodeWhispererConstants . autoScansConfig . settingId ,
263- settingState : CodeWhispererConstants . autoScansConfig . activated ,
263+ settingState : CodeWhispererConstants . autoScansConfig . deactivated ,
264264 } )
265265 } )
266266
0 commit comments