Correctly restore MatrixClientPeg after each test case

This commit is contained in:
Richard van der Hoff 2016-04-07 16:47:17 +01:00
parent b64604964d
commit a2168efcda
3 changed files with 30 additions and 7 deletions

View file

@ -3,16 +3,21 @@ 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 peg = require('../../../src/MatrixClientPeg.js');
var q = require('q');
describe('MatrixChat', function () {
var MatrixChat;
before(function() {
test_utils.stubClient();
MatrixChat = sdk.getComponent('structures.MatrixChat');
var sandbox;
beforeEach(function() {
sandbox = test_utils.stubClient();
});
afterEach(function() {
sandbox.restore();
});
it('gives a login panel by default', function () {