Commit 70b7600a authored by Phil Hughes's avatar Phil Hughes

Fixes collapsed files not loading in single file mode

Changelog: fixed

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/290745
parent 020110b3
......@@ -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