Commit 05209977 authored by Paul Slaughter's avatar Paul Slaughter

Move changed_file_icon deleted test to parameter

parent cfeaf97a
......@@ -5,6 +5,7 @@ import Icon from '~/vue_shared/components/icon.vue';
const changedFile = () => ({ changed: true });
const stagedFile = () => ({ changed: true, staged: true });
const newFile = () => ({ changed: true, tempFile: true });
const deletedFile = () => ({ changed: false, tempFile: false, staged: false, deleted: true });
const unchangedFile = () => ({ changed: false, tempFile: false, staged: false, deleted: false });
describe('Changed file icon', () => {
......@@ -58,9 +59,10 @@ describe('Changed file icon', () => {
${changedFile()} | ${'file-modified'} | ${'Modified'} | ${'with file changed'}
${stagedFile()} | ${'file-modified-solid'} | ${'Modified'} | ${'with file staged'}
${newFile()} | ${'file-addition'} | ${'Added'} | ${'with file new'}
${deletedFile()} | ${'file-deletion'} | ${'Deleted'} | ${'with file deleted'}
`('$desc', ({ file, iconName, tooltipText }) => {
beforeEach(() => {
factory({ file, tooltipTitle: tooltipText });
factory({ file });
});
it('renders icon', () => {
......@@ -73,16 +75,6 @@ describe('Changed file icon', () => {
});
});
it('shows "Deleted" tooltip if file has been deleted', () => {
factory({
file: {
deleted: true,
},
});
expect(findTooltipText()).toBe('Deleted');
});
describe('with file unchanged', () => {
beforeEach(() => {
factory({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment