Commit ee2778b5 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/290745/fixSingleDownloadDiff' into 'master'

Fixes collapsed files not loading in single file mode

See merge request gitlab-org/gitlab!67139
parents 9523a694 70b7600a
......@@ -205,6 +205,8 @@ export default {
if (this.hasDiff) {
this.postRender();
} else if (this.viewDiffsFileByFile && !this.isCollapsed) {
this.requestDiff();
}
this.manageViewedEffects();
......
......@@ -521,4 +521,24 @@ describe('DiffFile', () => {
expect(button.attributes('href')).toBe('/file/view/path');
});
});
it('loads collapsed file on mounted when single file mode is enabled', async () => {
wrapper.destroy();
const file = {
...getReadableFile(),
load_collapsed_diff_url: '/diff_for_path',
highlighted_diff_lines: [],
parallel_diff_lines: [],
viewer: { name: 'collapsed', automaticallyCollapsed: true },
};
axiosMock.onGet(file.load_collapsed_diff_url).reply(httpStatus.OK, getReadableFile());
({ wrapper, store } = createComponent({ file, props: { viewDiffsFileByFile: true } }));
await wrapper.vm.$nextTick();
expect(findLoader(wrapper).exists()).toBe(true);
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment