Add Duplicate Tab option (#8485)

* Add `Duplicate Tab` option

Adds an option to duplicate the current tab's setting/content into a new tab. Useful if you're iterating on a query.

* Add test
This commit is contained in:
Paul Vickers
2019-11-04 09:05:10 -08:00
committed by Erik Ritter
parent 51c22900db
commit 5df1fcb7bd
2 changed files with 18 additions and 0 deletions

View File

@@ -162,6 +162,14 @@ describe('TabbedSqlEditors', () => {
expect(wrapper.instance().props.actions.addQueryEditor.getCall(0).args[0].title)
.toContain('Untitled Query');
});
it('should duplicate query editor', () => {
wrapper = getWrapper();
sinon.stub(wrapper.instance().props.actions, 'cloneQueryToNewTab');
wrapper.instance().duplicateQueryEditor(queryEditors[0]);
expect(wrapper.instance().props.actions.cloneQueryToNewTab.getCall(0).args[0])
.toBe(queryEditors[0]);
});
it('should handle select', () => {
wrapper = getWrapper();
sinon.spy(wrapper.instance(), 'newQueryEditor');