diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 21:10:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 21:10:24 +0000 |
commit | 5838993b5f3e2d861d9dd7c82dfeea71506b9fc2 (patch) | |
tree | caab6621fb79f06a355f802dc885982f746b544d /spec/frontend/diffs/components/diff_file_spec.js | |
parent | b8d021cb606ac86f41a0ef9dacd133a9677f8414 (diff) | |
download | gitlab-ce-5838993b5f3e2d861d9dd7c82dfeea71506b9fc2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/diffs/components/diff_file_spec.js')
-rw-r--r-- | spec/frontend/diffs/components/diff_file_spec.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/frontend/diffs/components/diff_file_spec.js b/spec/frontend/diffs/components/diff_file_spec.js index 71e0ffd176f..77d83b102aa 100644 --- a/spec/frontend/diffs/components/diff_file_spec.js +++ b/spec/frontend/diffs/components/diff_file_spec.js @@ -96,13 +96,13 @@ function createComponent({ file, first = false, last = false }) { }; } -const findDiffHeader = wrapper => wrapper.find(DiffFileHeaderComponent); -const findDiffContentArea = wrapper => wrapper.find('[data-testid="content-area"]'); -const findLoader = wrapper => wrapper.find('[data-testid="loader-icon"]'); -const findToggleButton = wrapper => wrapper.find('[data-testid="expand-button"]'); +const findDiffHeader = (wrapper) => wrapper.find(DiffFileHeaderComponent); +const findDiffContentArea = (wrapper) => wrapper.find('[data-testid="content-area"]'); +const findLoader = (wrapper) => wrapper.find('[data-testid="loader-icon"]'); +const findToggleButton = (wrapper) => wrapper.find('[data-testid="expand-button"]'); -const toggleFile = wrapper => findDiffHeader(wrapper).vm.$emit('toggleFile'); -const isDisplayNone = element => element.style.display === 'none'; +const toggleFile = (wrapper) => findDiffHeader(wrapper).vm.$emit('toggleFile'); +const isDisplayNone = (element) => element.style.display === 'none'; const getReadableFile = () => JSON.parse(JSON.stringify(diffFileMockDataReadable)); const getUnreadableFile = () => JSON.parse(JSON.stringify(diffFileMockDataUnreadable)); @@ -157,7 +157,7 @@ describe('DiffFile', () => { await wrapper.vm.$nextTick(); expect(eventHub.$emit).toHaveBeenCalledTimes(events.length); - events.forEach(event => { + events.forEach((event) => { expect(eventHub.$emit).toHaveBeenCalledWith(event); }); }, @@ -174,7 +174,7 @@ describe('DiffFile', () => { })); jest.spyOn(wrapper.vm, 'loadCollapsedDiff').mockResolvedValue(getReadableFile()); - jest.spyOn(window, 'requestIdleCallback').mockImplementation(fn => fn()); + jest.spyOn(window, 'requestIdleCallback').mockImplementation((fn) => fn()); makeFileAutomaticallyCollapsed(store); @@ -247,7 +247,7 @@ describe('DiffFile', () => { it('should not have any content at all', async () => { await wrapper.vm.$nextTick(); - Array.from(findDiffContentArea(wrapper).element.children).forEach(child => { + Array.from(findDiffContentArea(wrapper).element.children).forEach((child) => { expect(isDisplayNone(child)).toBe(true); }); }); |