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