fixed karma

This commit is contained in:
Phil Hughes 2018-07-31 10:33:44 +01:00
parent 9712a6dd18
commit 3cbc2ea114
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
1 changed files with 14 additions and 3 deletions

View File

@ -64,15 +64,26 @@ describe('new file modal component', () => {
path: '',
entry: {
name: 'test',
type: 'blob',
},
};
vm = createComponentWithStore(Component, store).$mount();
});
it('renders title and button for renaming', () => {
expect(vm.$el.querySelector('.modal-title').textContent.trim()).toBe('Rename');
expect(vm.$el.querySelector('.btn-success').textContent.trim()).toBe('Update');
['tree', 'blob'].forEach(type => {
it(`renders title and button for renaming ${type}`, done => {
const text = type === 'tree' ? 'folder' : 'file';
vm.$store.state.entryModal.entry.type = type;
vm.$nextTick(() => {
expect(vm.$el.querySelector('.modal-title').textContent.trim()).toBe(`Rename ${text}`);
expect(vm.$el.querySelector('.btn-success').textContent.trim()).toBe(`Rename ${text}`);
done();
});
});
});
describe('entryName', () => {