Commit 9b2fda53 authored by Phil Hughes's avatar Phil Hughes

added specs & fixed specs

parent 566d6ac4
import Vue from 'vue';
import changedFileIcon from '~/ide/components/changed_file_icon.vue';
import createComponent from '../../helpers/vue_mount_component_helper';
describe('IDE changed file icon', () => {
let vm;
beforeEach(() => {
const component = Vue.extend(changedFileIcon);
vm = createComponent(component, {
file: {
tempFile: false,
},
});
});
afterEach(() => {
vm.$destroy();
});
describe('changedIcon', () => {
it('equals file-modified when not a temp file', () => {
expect(vm.changedIcon).toBe('file-modified');
});
it('equals file-addition when a temp file', () => {
vm.file.tempFile = true;
expect(vm.changedIcon).toBe('file-addition');
});
});
describe('changedIconClass', () => {
it('includes multi-file-changed-icon as standard', () => {
expect(vm.changedIconClass).toContain('multi-file-changed-icon');
});
it('includes multi-file-modified when not a temp file', () => {
expect(vm.changedIconClass).toContain('multi-file-modified');
});
it('includes multi-file-addition when a temp file', () => {
vm.file.tempFile = true;
expect(vm.changedIconClass).toContain('multi-file-addition');
});
});
});
......@@ -55,16 +55,6 @@ describe('RepoTab', () => {
expect(vm.closeFile).toHaveBeenCalledWith(vm.tab);
});
it('shows changed icon if tab is changed', () => {
const tab = file('changedFile');
tab.changed = true;
vm = createComponent({
tab,
});
expect(vm.changedIcon).toBe('file-modified');
});
it('changes icon on hover', (done) => {
const tab = file();
tab.changed = true;
......
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