Commit 3cbc2ea1 authored by Phil Hughes's avatar Phil Hughes

fixed karma

parent 9712a6dd
......@@ -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', () => {
......
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