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

fixed karma

parent 9712a6dd
...@@ -64,15 +64,26 @@ describe('new file modal component', () => { ...@@ -64,15 +64,26 @@ describe('new file modal component', () => {
path: '', path: '',
entry: { entry: {
name: 'test', name: 'test',
type: 'blob',
}, },
}; };
vm = createComponentWithStore(Component, store).$mount(); vm = createComponentWithStore(Component, store).$mount();
}); });
it('renders title and button for renaming', () => { ['tree', 'blob'].forEach(type => {
expect(vm.$el.querySelector('.modal-title').textContent.trim()).toBe('Rename'); it(`renders title and button for renaming ${type}`, done => {
expect(vm.$el.querySelector('.btn-success').textContent.trim()).toBe('Update'); 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', () => { 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