@@ -193,36 +193,36 @@ describe('CodeWhisperer-basicCommands', function () {
193
193
codeScansState = new TestCodeScansState ( )
194
194
} )
195
195
196
- it ( 'has auto scans enabled by default' , async function ( ) {
196
+ it ( 'has auto scans disabled by default' , async function ( ) {
197
197
targetCommand = testCommand ( toggleCodeScans , codeScansState )
198
- assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
198
+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
199
199
} )
200
200
201
201
it ( 'toggles states as expected' , async function ( ) {
202
202
targetCommand = testCommand ( toggleCodeScans , codeScansState )
203
- assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
204
- await targetCommand . execute ( placeholder , cwQuickPickSource )
205
203
assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
206
204
await targetCommand . execute ( placeholder , cwQuickPickSource )
207
205
assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
208
206
await targetCommand . execute ( placeholder , cwQuickPickSource )
209
207
assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
208
+ await targetCommand . execute ( placeholder , cwQuickPickSource )
209
+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
210
210
} )
211
211
212
212
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
217
214
assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
218
215
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 )
222
218
223
- // set to opposite state
219
+ // set new state to current state
224
220
await codeScansState . setScansEnabled ( true )
225
221
assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
222
+
223
+ // set to opposite state
224
+ await codeScansState . setScansEnabled ( false )
225
+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
226
226
} )
227
227
228
228
it ( 'triggers event listener when toggled' , async function ( ) {
@@ -239,28 +239,28 @@ describe('CodeWhisperer-basicCommands', function () {
239
239
assert . strictEqual ( eventListener . callCount , 1 )
240
240
} )
241
241
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 ( ) {
243
243
targetCommand = testCommand ( toggleCodeScans , codeScansState )
244
244
await targetCommand . execute ( placeholder , cwQuickPickSource )
245
245
246
- assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
246
+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
247
247
assertTelemetryCurried ( 'aws_modifySetting' ) ( {
248
248
settingId : CodeWhispererConstants . autoScansConfig . settingId ,
249
- settingState : CodeWhispererConstants . autoScansConfig . deactivated ,
249
+ settingState : CodeWhispererConstants . autoScansConfig . activated ,
250
250
} )
251
251
} )
252
252
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 )
256
256
257
257
targetCommand = testCommand ( toggleCodeScans , codeScansState )
258
258
await targetCommand . execute ( placeholder , cwQuickPickSource )
259
259
260
- assert . strictEqual ( codeScansState . isScansEnabled ( ) , true )
260
+ assert . strictEqual ( codeScansState . isScansEnabled ( ) , false )
261
261
assertTelemetryCurried ( 'aws_modifySetting' ) ( {
262
262
settingId : CodeWhispererConstants . autoScansConfig . settingId ,
263
- settingState : CodeWhispererConstants . autoScansConfig . activated ,
263
+ settingState : CodeWhispererConstants . autoScansConfig . deactivated ,
264
264
} )
265
265
} )
266
266
0 commit comments