diff options
Diffstat (limited to 'spec/frontend/diffs/components/diff_row_utils_spec.js')
-rw-r--r-- | spec/frontend/diffs/components/diff_row_utils_spec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/diffs/components/diff_row_utils_spec.js b/spec/frontend/diffs/components/diff_row_utils_spec.js index d70d6b609ac..47ae3cd5867 100644 --- a/spec/frontend/diffs/components/diff_row_utils_spec.js +++ b/spec/frontend/diffs/components/diff_row_utils_spec.js @@ -143,10 +143,21 @@ describe('addCommentTooltip', () => { 'Commenting on symbolic links that replace or are replaced by files is currently not supported.'; const brokenRealTooltip = 'Commenting on files that replace or are replaced by symbolic links is currently not supported.'; + const commentTooltip = 'Add a comment to this line'; + const dragTooltip = 'Add a comment to this line or drag for multiple lines'; + it('should return default tooltip', () => { expect(utils.addCommentTooltip()).toBeUndefined(); }); + it('should return comment tooltip', () => { + expect(utils.addCommentTooltip({})).toEqual(commentTooltip); + }); + + it('should return drag comment tooltip when dragging is enabled', () => { + expect(utils.addCommentTooltip({}, true)).toEqual(dragTooltip); + }); + it('should return broken symlink tooltip', () => { expect(utils.addCommentTooltip({ commentsDisabled: { wasSymbolic: true } })).toEqual( brokenSymLinkTooltip, |