Ensure arrow keys work correctly when the pane is focused instead of the tab in the query tool history.

This commit is contained in:
Harshal Dhumal
2017-07-21 13:33:59 +01:00
committed by Dave Page
parent 70418144cf
commit 7182b59976
3 changed files with 14 additions and 12 deletions

View File

@@ -36,11 +36,11 @@ describe('QueryHistory', () => {
describe('when we switch to the query history tab', () => {
beforeEach(() => {
historyWrapper.node.refocus();
spyOn(historyWrapper.node, 'retrieveSelectedQuery');
spyOn(historyWrapper.node, 'retrieveQueryListPane');
});
it('does not try to focus on any element', () => {
expect(historyWrapper.node.retrieveSelectedQuery).not.toHaveBeenCalled();
expect(historyWrapper.node.retrieveQueryListPane).not.toHaveBeenCalled();
});
});
@@ -49,7 +49,7 @@ describe('QueryHistory', () => {
expect(foundChildren.length).toBe(0);
done();
});
it('nothing is displayed on right panel', (done) => {
let foundChildren = historyWrapper.find(QueryHistoryDetail);
expect(foundChildren.length).toBe(1);
@@ -264,7 +264,7 @@ describe('QueryHistory', () => {
beforeEach(() => {
selectedListItem = ReactDOM.findDOMNode(historyWrapper.node)
.getElementsByClassName('selected')[0].parentElement;
.getElementsByClassName('query-history')[0];
spyOn(selectedListItem, 'focus');
historyWrapper.node.refocus();