@@ -115,6 +115,8 @@ define(function (require, exports, module) {
115115 }
116116 }
117117
118+ let savedCopyFn ;
119+
118120 beforeAll ( async function ( ) {
119121 testWindow = await SpecRunnerUtils . createTestWindowAndRun ( { forceReload : true } ) ;
120122 // Load module instances from brackets.test
@@ -127,20 +129,22 @@ define(function (require, exports, module) {
127129 CodeInspection = brackets . test . CodeInspection ;
128130 PreferencesManager = brackets . test . PreferencesManager ;
129131 CodeInspection . toggleEnabled ( true ) ;
130-
131132 await SpecRunnerUtils . loadProjectInTestWindow ( testFolder ) ;
133+ savedCopyFn = testWindow . Phoenix . app . copyToClipboard ;
132134 } , 30000 ) ;
133135
134136 beforeEach ( function ( ) {
135137 // this is to make the tests run faster
136138 prefs . set ( CodeInspection . _PREF_ASYNC_TIMEOUT , 500 ) ;
139+ testWindow . Phoenix . app . copyToClipboard = savedCopyFn ;
137140 } ) ;
138141
139142 afterEach ( function ( ) {
140143 testWindow . closeAllFiles ( ) ;
141144 } ) ;
142145
143146 afterAll ( async function ( ) {
147+ testWindow . Phoenix . app . copyToClipboard = savedCopyFn ;
144148 testWindow = null ;
145149 $ = null ;
146150 brackets = null ;
@@ -1079,6 +1083,25 @@ define(function (require, exports, module) {
10791083 expect ( fixPos ( EditorManager . getActiveEditor ( ) . getCursorPos ( ) ) ) . toEqual ( fixPos ( { line : 1 , ch : 3 } ) ) ;
10801084 } ) ;
10811085
1086+ it ( "should be able to copy problem message" , async function ( ) {
1087+ const codeInspector = createCodeInspector ( "javascript linter" , failLintResult ( ) ) ;
1088+ CodeInspection . register ( "javascript" , codeInspector ) ;
1089+
1090+ await awaitsForDone ( SpecRunnerUtils . openProjectFiles ( [ "errors.js" ] ) , "open test file" ) ;
1091+
1092+ const $problemLine = CodeInspection . scrollToProblem ( 1 ) ;
1093+ let copiedVal ;
1094+ testWindow . Phoenix . app . copyToClipboard = function ( val ) {
1095+ copiedVal = val ;
1096+ } ;
1097+ const $copyBtnElems = $problemLine . find ( ".ph-copy-problem" ) ;
1098+ for ( let i = 0 ; i < $copyBtnElems . length ; i ++ ) {
1099+ copiedVal = null ;
1100+ $copyBtnElems [ i ] . click ( ) ;
1101+ expect ( copiedVal ) . toBe ( "Some errors here and there" ) ;
1102+ }
1103+ } ) ;
1104+
10821105 it ( "should Go to First Error with errors from two providers" , async function ( ) {
10831106 var codeInspector1 = createCodeInspector ( "javascript linter 1" , {
10841107 errors : [
0 commit comments