Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/protocols/abstract/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AbstractWrapper extends KuzzleEventEmitter {
}

get connected () {
return this.state === 'online';
return this.state === 'connected';
}

get pendingRequests () {
Expand Down
12 changes: 12 additions & 0 deletions test/protocol/common.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down