|
|
@ -28,13 +28,14 @@ |
|
|
|
|
|
|
|
|
|
|
|
/*jshint expr: true*/ |
|
|
|
/*jshint expr: true*/ |
|
|
|
|
|
|
|
|
|
|
|
describe.only('workPackageCommentDirectiveTest', function() { |
|
|
|
describe('workPackageCommentDirectiveTest', function() { |
|
|
|
var I18n, ActivityService, compile, scope, element, stateParams, q, commentCreation; |
|
|
|
var I18n, ActivityService, compile, scope, element, stateParams, q, commentCreation; |
|
|
|
var workPackageFieldService = {}; |
|
|
|
var workPackageFieldService = {}; |
|
|
|
var html = "<work-package-comment work-package='workPackage' activities='activities'></work-package-comment>"; |
|
|
|
var html = "<work-package-comment work-package='workPackage' activities='activities'></work-package-comment>"; |
|
|
|
stateParams = {}; |
|
|
|
stateParams = {}; |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(angular.mock.module('ui.router', |
|
|
|
beforeEach(angular.mock.module('ui.router', |
|
|
|
|
|
|
|
'openproject', |
|
|
|
'openproject.api', |
|
|
|
'openproject.api', |
|
|
|
'openproject.models', |
|
|
|
'openproject.models', |
|
|
|
'openproject.layout', |
|
|
|
'openproject.layout', |
|
|
@ -90,8 +91,10 @@ describe.only('workPackageCommentDirectiveTest', function() { |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(function() { |
|
|
|
beforeEach(function() { |
|
|
|
var workPackage = { |
|
|
|
var workPackage = { |
|
|
|
links: { |
|
|
|
addComment: { |
|
|
|
addComment: { href: 'addComment' }, |
|
|
|
$link: { |
|
|
|
|
|
|
|
href: 'addComment' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -107,8 +110,7 @@ describe.only('workPackageCommentDirectiveTest', function() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should not display the comments form', function() { |
|
|
|
it('should not display the comments form', function() { |
|
|
|
expect(element.find('.work-packages--activity--add-comment').hasClass('ng-hide')) |
|
|
|
expect(element.find('.work-packages--activity--add-comment').length).to.equal(0); |
|
|
|
.to.equal(true); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -126,13 +128,13 @@ describe.only('workPackageCommentDirectiveTest', function() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should display a placeholder in the comments field', function() { |
|
|
|
it('should display a placeholder in the comments field', function() { |
|
|
|
var readvalue = commentSection.find('.inplace-edit--read-value'); |
|
|
|
var readvalue = commentSection.find('.inplace-edit--read-value > span'); |
|
|
|
expect(readvalue.text().trim()).to.equal('trans_title'); |
|
|
|
expect(readvalue.text().trim()).to.equal('trans_title'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
describe('when clicking the inplace edit', function() { |
|
|
|
describe('when clicking the inplace edit', function() { |
|
|
|
beforeEach(function() { |
|
|
|
beforeEach(function() { |
|
|
|
commentSection.find('.inplace-_editing--trigger-link').click(); |
|
|
|
commentSection.find('.inplace-editing--trigger-link').click(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('does not allow sending comment with an empty message', function() { |
|
|
|
it('does not allow sending comment with an empty message', function() { |
|
|
|