Stub out the matrix client

This commit is contained in:
Richard van der Hoff 2016-03-28 22:59:34 +01:00
parent 7e1e2347b5
commit 5f3b82a767
3 changed files with 68 additions and 10 deletions

View file

@ -3,14 +3,21 @@ var TestUtils = require('react-addons-test-utils');
var expect = require('expect');
var sdk = require('matrix-react-sdk');
var MatrixChat;
var test_utils = require('../../test-utils');
var peg = require('../../../src/MatrixClientPeg.js');
var q = require('q');
describe('MatrixChat', function () {
var MatrixChat;
before(function() {
test_utils.stubClient();
MatrixChat = sdk.getComponent('structures.MatrixChat');
});
it('gives a login panel by default', function () {
peg.get().loginFlows.returns(q({}));
var res = TestUtils.renderIntoDocument(
<MatrixChat config={{}}/>
);