Display click to expand on collapsed diffs

This commit is contained in:
André Luís 2018-09-13 11:59:50 +01:00
parent 71f3d48544
commit 06025e4a26
3 changed files with 19 additions and 1 deletions

View File

@ -44,7 +44,7 @@ export default {
},
showExpandMessage() {
return (
!this.isCollapsed &&
this.isCollapsed ||
!this.file.highlightedDiffLines &&
!this.isLoadingCollapsedDiff &&
!this.file.tooLarge &&

View File

@ -0,0 +1,6 @@
---
title: Fix absent Click to Expand link on diffs not rendered on first load of Merge
Requests Changes tab
merge_request: 21716
author:
type: fixed

View File

@ -63,6 +63,18 @@ describe('DiffFile', () => {
});
});
it('should have collapsed text and link even before rendered', done => {
vm.file.renderIt = false;
vm.file.collapsed = true;
vm.$nextTick(() => {
expect(vm.$el.innerText).toContain('This diff is collapsed');
expect(vm.$el.querySelectorAll('.js-click-to-expand').length).toEqual(1);
done();
});
});
it('should have loading icon while loading a collapsed diffs', done => {
vm.file.collapsed = true;
vm.isLoadingCollapsedDiff = true;