diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-15 21:10:04 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-15 21:10:04 +0000 |
commit | 83d921d51bd5bf8bd0ecd078706d7c037fb711cb (patch) | |
tree | f8f43552f05e747c06d16ac82b23eb33182a9e8f /spec/frontend/diffs/components/diff_stats_spec.js | |
parent | a8476fe0cd764ac054763032b7cf6e63b0b493c5 (diff) | |
download | gitlab-ce-83d921d51bd5bf8bd0ecd078706d7c037fb711cb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/diffs/components/diff_stats_spec.js')
-rw-r--r-- | spec/frontend/diffs/components/diff_stats_spec.js | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/spec/frontend/diffs/components/diff_stats_spec.js b/spec/frontend/diffs/components/diff_stats_spec.js index 52e68b35889..4ef1ec55cb0 100644 --- a/spec/frontend/diffs/components/diff_stats_spec.js +++ b/spec/frontend/diffs/components/diff_stats_spec.js @@ -1,5 +1,7 @@ import { GlIcon } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; +import { extendedWrapper } from 'helpers/vue_test_utils_helper'; + import DiffStats from '~/diffs/components/diff_stats.vue'; import mockDiffFile from '../mock_data/diff_file'; @@ -12,13 +14,15 @@ describe('diff_stats', () => { let wrapper; const createComponent = (props = {}) => { - wrapper = shallowMount(DiffStats, { - propsData: { - addedLines: TEST_ADDED_LINES, - removedLines: TEST_REMOVED_LINES, - ...props, - }, - }); + wrapper = extendedWrapper( + shallowMount(DiffStats, { + propsData: { + addedLines: TEST_ADDED_LINES, + removedLines: TEST_REMOVED_LINES, + ...props, + }, + }), + ); }; describe('diff stats group', () => { @@ -58,24 +62,24 @@ describe('diff_stats', () => { it("renders the bytes changes instead of line changes when the file isn't diffable", () => { const content = getBytesContainer(); - expect(content.classes('cgreen')).toBe(true); + expect(content.classes('gl-text-green-600')).toBe(true); expect(content.text()).toBe('+1.00 KiB (+100%)'); }); }); describe('line changes', () => { - const findFileLine = (name) => wrapper.find(name); + const findFileLine = (name) => wrapper.findByTestId(name); beforeEach(() => { createComponent(); }); it('shows the amount of lines added', () => { - expect(findFileLine('.js-file-addition-line').text()).toBe(TEST_ADDED_LINES.toString()); + expect(findFileLine('js-file-addition-line').text()).toBe(TEST_ADDED_LINES.toString()); }); it('shows the amount of lines removed', () => { - expect(findFileLine('.js-file-deletion-line').text()).toBe(TEST_REMOVED_LINES.toString()); + expect(findFileLine('js-file-deletion-line').text()).toBe(TEST_REMOVED_LINES.toString()); }); }); |