element-web/test/components/structures/MatrixChat-test.js

30 lines
851 B
JavaScript
Raw Normal View History

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