Start to factor out session-loading magic
Take some of the magic out of MatrixChat.componentDidMount() into a new component. Also delete the MatrixChat test. It wasn't really doing much, is broken by the change, and I am replacing it with (better) app-level tests in the vector project.
This commit is contained in:
parent
0351ab0a3d
commit
24841cc5c4
5 changed files with 200 additions and 109 deletions
|
@ -1,34 +0,0 @@
|
|||
var React = require('react');
|
||||
var TestUtils = require('react-addons-test-utils');
|
||||
var expect = require('expect');
|
||||
|
||||
var sdk = require('matrix-react-sdk');
|
||||
var MatrixChat = sdk.getComponent('structures.MatrixChat');
|
||||
var peg = require('../../../src/MatrixClientPeg');
|
||||
|
||||
var test_utils = require('../../test-utils');
|
||||
var q = require('q');
|
||||
|
||||
describe('MatrixChat', function () {
|
||||
var sandbox;
|
||||
|
||||
beforeEach(function() {
|
||||
sandbox = test_utils.stubClient();
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
sandbox.restore();
|
||||
});
|
||||
|
||||
it('gives a login panel by default', function () {
|
||||
peg.get().loginFlows.returns(q({flows:[]}));
|
||||
|
||||
var res = TestUtils.renderIntoDocument(
|
||||
<MatrixChat config={{}}/>
|
||||
);
|
||||
|
||||
// we expect a single <Login> component
|
||||
TestUtils.findRenderedComponentWithType(
|
||||
res, sdk.getComponent('structures.login.Login'));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue