diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-15 03:12:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-15 03:12:58 +0300 |
commit | 45465a1f217b65ee3b11870175f363afaf912eb9 (patch) | |
tree | 0f4103ad51619ed03fc47cc28e32df3fb57b5c0c /spec/frontend/diffs | |
parent | 046498496e140f96beb63ff45ec9b0bb9acdbdd3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/diffs')
-rw-r--r-- | spec/frontend/diffs/components/diff_file_spec.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/frontend/diffs/components/diff_file_spec.js b/spec/frontend/diffs/components/diff_file_spec.js index 90c42e6e5db..a9fbf4632ac 100644 --- a/spec/frontend/diffs/components/diff_file_spec.js +++ b/spec/frontend/diffs/components/diff_file_spec.js @@ -399,6 +399,27 @@ describe('DiffFile', () => { }); }); + describe('automatically collapsed generated file', () => { + beforeEach(() => { + makeFileAutomaticallyCollapsed(store); + const file = store.state.diffs.diffFiles[0]; + Object.assign(store.state.diffs.diffFiles[0], { + ...file, + viewer: { + ...file.viewer, + generated: true, + }, + }); + }); + + it('should show the generated file warning with expansion button', () => { + expect(findDiffContentArea(wrapper).html()).toContain( + 'Generated files are collapsed by default. This behavior can be overriden via .gitattributes file if required.', + ); + expect(findToggleButton(wrapper).exists()).toBe(true); + }); + }); + describe('not collapsed', () => { beforeEach(() => { makeFileOpenByDefault(store); |