You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Correctly restore MatrixClientPeg after each test case
This commit is contained in:
@ -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 () {
|
||||
|
@ -27,12 +27,19 @@ var test_utils = require('test-utils');
|
||||
var mockclock = require('mock-clock');
|
||||
|
||||
describe('MessagePanel', function () {
|
||||
var sandbox;
|
||||
var clock = mockclock.clock();
|
||||
var realSetTimeout = window.setTimeout;
|
||||
var events = mkEvents();
|
||||
|
||||
beforeEach(function() {
|
||||
test_utils.beforeEach(this);
|
||||
sandbox = test_utils.stubClient(sandbox);
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
clock.uninstall();
|
||||
sandbox.restore();
|
||||
});
|
||||
|
||||
function mkEvents() {
|
||||
|
Reference in New Issue
Block a user