@@ -528,8 +528,8 @@ define(function (require, exports, module) {
528528 expect ( marks [ 0 ] . className ) . toBe ( "editor-text-fragment-warn" ) ;
529529 } ) ;
530530
531- it ( "should show warning gutter icon on line in editor" , async function ( ) {
532- let codeInspector = createCodeInspector ( "javascript linter" , failLintResult ( ) ) ;
531+ async function _testWarningIcon ( lintResult , expectedClass ) {
532+ let codeInspector = createCodeInspector ( "javascript linter" , lintResult ) ;
533533 CodeInspection . register ( "javascript" , codeInspector ) ;
534534
535535 await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "errors.js" ] ) , "open test file" , 5000 ) ;
@@ -538,7 +538,37 @@ define(function (require, exports, module) {
538538 let marks = EditorManager . getActiveEditor ( ) . getGutterMarker ( 1 , CodeInspection . CODE_INSPECTION_GUTTER ) ;
539539 expect ( marks . title ) . toBe ( '\nSome errors here and there at column: 4' ) ;
540540 marks = $ ( marks ) ;
541- expect ( marks . find ( 'span' ) . hasClass ( 'line-icon-problem_type_warning' ) ) . toBeTrue ( ) ;
541+ expect ( marks . find ( 'span' ) . hasClass ( expectedClass ) ) . toBeTrue ( ) ;
542+ return marks ;
543+ }
544+
545+ it ( "should show warning gutter icon on line in editor" , async function ( ) {
546+ await _testWarningIcon ( failLintResult ( ) , 'line-icon-problem_type_warning' ) ;
547+ } ) ;
548+
549+ it ( "should show fix icon in gutter for warning on line in editor" , async function ( ) {
550+ const marks = await _testWarningIcon ( failLintResult ( true ) , 'line-icon-problem_type_warning' ) ;
551+ expect ( marks . find ( 'span' ) . hasClass ( 'fa-wrench' ) ) . toBeTrue ( ) ;
552+ const $problemLineInPanel = CodeInspection . scrollToProblem ( 1 ) ;
553+ expect ( $problemLineInPanel . find ( "i" ) . hasClass ( "fa-wrench" ) ) . toBeTrue ( ) ;
554+ } ) ;
555+
556+ it ( "should show fix icon in gutter for error on line in editor" , async function ( ) {
557+ const errorResult = failLintResult ( true ) ;
558+ errorResult . errors [ 0 ] . type = CodeInspection . Type . ERROR ;
559+ const marks = await _testWarningIcon ( errorResult , 'line-icon-problem_type_error' ) ;
560+ expect ( marks . find ( 'span' ) . hasClass ( 'fa-wrench' ) ) . toBeTrue ( ) ;
561+ const $problemLineInPanel = CodeInspection . scrollToProblem ( 1 ) ;
562+ expect ( $problemLineInPanel . find ( "i" ) . hasClass ( "fa-wrench" ) ) . toBeTrue ( ) ;
563+ } ) ;
564+
565+ it ( "should show fix icon in gutter and panel for info on line in editor" , async function ( ) {
566+ const errorResult = failLintResult ( true ) ;
567+ errorResult . errors [ 0 ] . type = CodeInspection . Type . META ;
568+ const marks = await _testWarningIcon ( errorResult , 'line-icon-problem_type_info' ) ;
569+ expect ( marks . find ( 'span' ) . hasClass ( 'fa-wrench' ) ) . toBeTrue ( ) ;
570+ const $problemLineInPanel = CodeInspection . scrollToProblem ( 1 ) ;
571+ expect ( $problemLineInPanel . find ( "i" ) . hasClass ( "fa-wrench" ) ) . toBeTrue ( ) ;
542572 } ) ;
543573
544574 it ( "should not show codeinspection gutter on unsupported languages" , async function ( ) {
0 commit comments