diff --git a/package-lock.json b/package-lock.json index 9ab7562bb..20a17db84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kuzzle-sdk", - "version": "6.2.4", + "version": "6.2.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a59a7e716..c3a24f995 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-sdk", - "version": "6.2.4", + "version": "6.2.5", "description": "Official Javascript SDK for Kuzzle", "author": "The Kuzzle Team ", "repository": { diff --git a/src/protocols/abstract/common.js b/src/protocols/abstract/common.js index 5c563a334..8eec74705 100644 --- a/src/protocols/abstract/common.js +++ b/src/protocols/abstract/common.js @@ -40,7 +40,7 @@ class AbstractWrapper extends KuzzleEventEmitter { } get connected () { - return this.state === 'online'; + return this.state === 'connected'; } get pendingRequests () { diff --git a/test/protocol/common.test.js b/test/protocol/common.test.js index 00111ad97..329eb2414 100644 --- a/test/protocol/common.test.js +++ b/test/protocol/common.test.js @@ -18,6 +18,18 @@ describe('Common Protocol', () => { sendSpy = sinon.spy(protocol, 'send'); }); + describe('#connected', () => { + it('should return true if the protocol state is "connected"', () => { + protocol.state = 'connected'; + + should(protocol.connected).be.True(); + + protocol.state = 'disconnected'; + + should(protocol.connected).be.False(); + }); + }); + describe('#query', () => { beforeEach(() => {