summaryrefslogtreecommitdiff
path: root/spec/frontend/diffs/components
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 21:08:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 21:08:54 +0000
commit36e363d33d5f75aeb75c552d4b325ed8c2d6105f (patch)
tree1ca97e2e47c613eed6b6cd4682c36c92067cab46 /spec/frontend/diffs/components
parentd91f5211693e913da5df110b8de841fad87e3653 (diff)
downloadgitlab-ce-36e363d33d5f75aeb75c552d4b325ed8c2d6105f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/diffs/components')
-rw-r--r--spec/frontend/diffs/components/compare_versions_spec.js3
-rw-r--r--spec/frontend/diffs/components/diff_stats_spec.js18
2 files changed, 15 insertions, 6 deletions
diff --git a/spec/frontend/diffs/components/compare_versions_spec.js b/spec/frontend/diffs/components/compare_versions_spec.js
index ff92a12eaf6..5f919408459 100644
--- a/spec/frontend/diffs/components/compare_versions_spec.js
+++ b/spec/frontend/diffs/components/compare_versions_spec.js
@@ -49,7 +49,8 @@ describe('CompareVersions', () => {
expect(treeListBtn.exists()).toBe(true);
expect(treeListBtn.attributes('title')).toBe('Hide file browser');
- expect(treeListBtn.find(Icon).props('name')).toBe('file-tree');
+ expect(treeListBtn.findAll(Icon).length).not.toBe(0);
+ expect(treeListBtn.find(Icon).props('name')).toBe('collapse-left');
});
it('should render comparison dropdowns with correct values', () => {
diff --git a/spec/frontend/diffs/components/diff_stats_spec.js b/spec/frontend/diffs/components/diff_stats_spec.js
index aa5c7f6278a..4482abf18c1 100644
--- a/spec/frontend/diffs/components/diff_stats_spec.js
+++ b/spec/frontend/diffs/components/diff_stats_spec.js
@@ -1,4 +1,5 @@
import { shallowMount } from '@vue/test-utils';
+import Icon from '~/vue_shared/components/icon.vue';
import DiffStats from '~/diffs/components/diff_stats.vue';
describe('diff_stats', () => {
@@ -23,11 +24,18 @@ describe('diff_stats', () => {
},
});
- const findFileLine = name => wrapper.find(name);
- const additions = findFileLine('.js-file-addition-line');
- const deletions = findFileLine('.js-file-deletion-line');
+ const findIcon = name =>
+ wrapper
+ .findAll(Icon)
+ .filter(c => c.attributes('name') === name)
+ .at(0).element.parentNode;
- expect(additions.text()).toBe('100');
- expect(deletions.text()).toBe('200');
+ const additions = findIcon('file-addition');
+ const deletions = findIcon('file-deletion');
+ const filesChanged = findIcon('doc-code');
+
+ expect(additions.textContent).toContain('100');
+ expect(deletions.textContent).toContain('200');
+ expect(filesChanged.textContent).toContain('300');
});
});