Add support for LISTEN/NOTIFY in the query tool. Fixes #3204

This commit is contained in:
Akshay Joshi
2018-05-30 21:58:28 -04:00
committed by Dave Page
parent 2b4605a9d3
commit 38ee39ae7a
11 changed files with 335 additions and 19 deletions

View File

@@ -43,6 +43,7 @@ describe('ExecuteQuery', () => {
'saveState',
'initTransaction',
'handle_connection_lost',
'update_notifications',
]);
sqlEditorMock.transId = 123;
sqlEditorMock.rows_affected = 1000;
@@ -76,7 +77,7 @@ describe('ExecuteQuery', () => {
describe('when query was successful', () => {
beforeEach(() => {
response = {
data: {status: 'Success'},
data: {status: 'Success', notifies: [{'pid': 100}]},
};
networkMock.onGet('/sqleditor/query_tool/poll/123').reply(200, response);
@@ -97,7 +98,15 @@ describe('ExecuteQuery', () => {
it('should render the results', (done) => {
setTimeout(() => {
expect(sqlEditorMock.call_render_after_poll)
.toHaveBeenCalledWith({status: 'Success'});
.toHaveBeenCalledWith({status: 'Success', notifies: [{'pid': 100}]});
done();
}, 0);
});
it('should update the notification panel', (done) => {
setTimeout(() => {
expect(sqlEditorMock.update_notifications)
.toHaveBeenCalledWith([{'pid': 100}]);
done();
}, 0);
});