mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* Switch websocket over to post-connect authentication * Add ability to specify token in websocket js driver, add unit tests * Temporarily disable client websocket tests until issues are resolved * Minor refactoring and fix status test * Add isAuthenticated method to WebConn and minor status updates
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
/*
|
|
var assert = require('assert');
|
|
import TestHelper from './test_helper.jsx';
|
|
|
|
describe('Client.WebSocket', function() {
|
|
this.timeout(10000);
|
|
|
|
it('WebSocket.getStatusesByIds', function(done) {
|
|
TestHelper.initBasic(() => {
|
|
TestHelper.basicWebSocketClient().getStatusesByIds(
|
|
[TestHelper.basicUser().id],
|
|
function(resp) {
|
|
TestHelper.basicWebSocketClient().close();
|
|
assert.equal(resp.data[TestHelper.basicUser().id], 'online');
|
|
done();
|
|
}
|
|
);
|
|
}, true);
|
|
});
|
|
|
|
it('WebSocket.getStatuses', function(done) {
|
|
TestHelper.initBasic(() => {
|
|
TestHelper.basicWebSocketClient().getStatuses(
|
|
function(resp) {
|
|
TestHelper.basicWebSocketClient().close();
|
|
assert.equal(resp.data != null, true);
|
|
done();
|
|
}
|
|
);
|
|
}, true);
|
|
});
|
|
|
|
it('WebSocket.userTyping', function(done) {
|
|
TestHelper.initBasic(() => {
|
|
TestHelper.basicWebSocketClient().userTyping(
|
|
TestHelper.basicChannel().id,
|
|
'',
|
|
function(resp) {
|
|
TestHelper.basicWebSocketClient().close();
|
|
assert.equal(resp.status, 'OK');
|
|
done();
|
|
}
|
|
);
|
|
}, true);
|
|
});
|
|
});*/
|
|
|