@@ -12,6 +12,7 @@ import {
1212 SeverityItem ,
1313 CodeIssueGroupingStrategyState ,
1414 CodeIssueGroupingStrategy ,
15+ sasRuleId ,
1516} from 'aws-core-vscode/codewhisperer'
1617import { createCodeScanIssue } from 'aws-core-vscode/test'
1718import assert from 'assert'
@@ -153,4 +154,24 @@ describe('SecurityIssueTreeViewProvider', function () {
153154 }
154155 } )
155156 } )
157+
158+ describe ( 'IssueItem' , function ( ) {
159+ it ( 'has issueWithFix context value for issues with suggested fix' , function ( ) {
160+ const issueItem = new IssueItem (
161+ 'file/path' ,
162+ createCodeScanIssue ( { suggestedFixes : [ { code : 'fixCode' , description : 'fixDescription' } ] } )
163+ )
164+ assert . strictEqual ( issueItem . contextValue , 'issueWithFix' )
165+ } )
166+
167+ it ( 'has issueWithoutFix context value for issues without suggested fix' , function ( ) {
168+ const issueItem = new IssueItem ( 'file/path' , createCodeScanIssue ( { suggestedFixes : [ ] } ) )
169+ assert . strictEqual ( issueItem . contextValue , 'issueWithoutFix' )
170+ } )
171+
172+ it ( 'has issueWithFixDisabled context value for SAS findings' , function ( ) {
173+ const issueItem = new IssueItem ( 'file/path' , createCodeScanIssue ( { ruleId : sasRuleId } ) )
174+ assert . strictEqual ( issueItem . contextValue , 'issueWithFixDisabled' )
175+ } )
176+ } )
156177} )
0 commit comments