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', () => {
|
2021-03-08 18:12:59 +05:30
|
|
|
const wrapper = mount(FileRowStats, {
|
|
|
|
propsData: {
|
2018-12-05 23:21:45 +05:30
|
|
|
file: {
|
|
|
|
addedLines: 20,
|
|
|
|
removedLines: 10,
|
|
|
|
},
|
2021-03-08 18:12:59 +05:30
|
|
|
},
|
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
|
|
|
});
|
|
|
|
});
|