debian-mirror-gitlab/spec/frontend/diffs/components/file_row_stats_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
631 B
JavaScript
Raw Normal View History

2021-03-08 18:12:59 +05:30
import { mount } from '@vue/test-utils';
2020-01-01 13:55:28 +05:30
import FileRowStats from '~/diffs/components/file_row_stats.vue';
2018-12-05 23:21:45 +05:30
describe('Diff file row stats', () => {
2022-11-25 23:54:43 +05:30
let wrapper;
const createComponent = () => {
wrapper = mount(FileRowStats, {
propsData: {
file: {
addedLines: 20,
removedLines: 10,
},
2018-12-05 23:21:45 +05:30
},
2022-11-25 23:54:43 +05:30
});
};
beforeEach(() => {
createComponent();
2018-12-05 23:21:45 +05:30
});
it('renders added lines count', () => {
2021-03-08 18:12:59 +05:30
expect(wrapper.find('.cgreen').text()).toContain('+20');
2018-12-05 23:21:45 +05:30
});
it('renders removed lines count', () => {
2021-03-08 18:12:59 +05:30
expect(wrapper.find('.cred').text()).toContain('-10');
2018-12-05 23:21:45 +05:30
});
});