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'; ...@@ -5,6 +5,7 @@ import Icon from '~/vue_shared/components/icon.vue';
const changedFile = () => ({ changed: true }); const changedFile = () => ({ changed: true });
const stagedFile = () => ({ changed: true, staged: true }); const stagedFile = () => ({ changed: true, staged: true });
const newFile = () => ({ changed: true, tempFile: 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 }); const unchangedFile = () => ({ changed: false, tempFile: false, staged: false, deleted: false });
describe('Changed file icon', () => { describe('Changed file icon', () => {
...@@ -58,9 +59,10 @@ describe('Changed file icon', () => { ...@@ -58,9 +59,10 @@ describe('Changed file icon', () => {
${changedFile()} | ${'file-modified'} | ${'Modified'} | ${'with file changed'} ${changedFile()} | ${'file-modified'} | ${'Modified'} | ${'with file changed'}
${stagedFile()} | ${'file-modified-solid'} | ${'Modified'} | ${'with file staged'} ${stagedFile()} | ${'file-modified-solid'} | ${'Modified'} | ${'with file staged'}
${newFile()} | ${'file-addition'} | ${'Added'} | ${'with file new'} ${newFile()} | ${'file-addition'} | ${'Added'} | ${'with file new'}
${deletedFile()} | ${'file-deletion'} | ${'Deleted'} | ${'with file deleted'}
`('$desc', ({ file, iconName, tooltipText }) => { `('$desc', ({ file, iconName, tooltipText }) => {
beforeEach(() => { beforeEach(() => {
factory({ file, tooltipTitle: tooltipText }); factory({ file });
}); });
it('renders icon', () => { it('renders icon', () => {
...@@ -73,16 +75,6 @@ describe('Changed file 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', () => { describe('with file unchanged', () => {
beforeEach(() => { beforeEach(() => {
factory({ 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