2016-03-29 00:36:22 +08:00
|
|
|
var React = require('react');
|
|
|
|
var TestUtils = require('react-addons-test-utils');
|
|
|
|
var expect = require('expect');
|
|
|
|
|
|
|
|
var sdk = require('matrix-react-sdk');
|
2016-03-29 05:59:34 +08:00
|
|
|
|
|
|
|
var test_utils = require('../../test-utils');
|
|
|
|
var peg = require('../../../src/MatrixClientPeg.js');
|
|
|
|
var q = require('q');
|
2016-03-29 00:36:22 +08:00
|
|
|
|
|
|
|
describe('MatrixChat', function () {
|
2016-03-29 05:59:34 +08:00
|
|
|
var MatrixChat;
|
2016-03-29 00:36:22 +08:00
|
|
|
before(function() {
|
2016-03-29 05:59:34 +08:00
|
|
|
test_utils.stubClient();
|
2016-03-29 00:36:22 +08:00
|
|
|
MatrixChat = sdk.getComponent('structures.MatrixChat');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('gives a login panel by default', function () {
|
2016-03-29 07:02:48 +08:00
|
|
|
peg.get().loginFlows.returns(q({flows:[]}));
|
2016-03-29 05:59:34 +08:00
|
|
|
|
2016-03-29 00:36:22 +08:00
|
|
|
var res = TestUtils.renderIntoDocument(
|
|
|
|
<MatrixChat config={{}}/>
|
|
|
|
);
|
|
|
|
|
|
|
|
// we expect a single <Login> component
|
|
|
|
TestUtils.findRenderedComponentWithType(
|
|
|
|
res, sdk.getComponent('structures.login.Login'));
|
|
|
|
});
|
|
|
|
});
|