Fix the MessagePanel test

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
turt2live 2017-09-14 20:47:24 -06:00
parent 3c71898237
commit 0363f73e28
3 changed files with 8 additions and 4 deletions

View file

@ -24,6 +24,7 @@ var sdk = require('matrix-react-sdk');
var MessagePanel = sdk.getComponent('structures.MessagePanel');
import UserSettingsStore from '../../../src/UserSettingsStore';
import MatrixClientPeg from '../../../src/MatrixClientPeg';
var test_utils = require('test-utils');
var mockclock = require('mock-clock');
@ -51,16 +52,19 @@ describe('MessagePanel', function () {
var clock = mockclock.clock();
var realSetTimeout = window.setTimeout;
var events = mkEvents();
var sandbox = null;
beforeEach(function() {
test_utils.beforeEach(this);
client = test_utils.createTestClient();
sandbox = test_utils.stubClient();
client = MatrixClientPeg.get();
client.credentials = {userId: '@me:here'};
UserSettingsStore.getSyncedSettings = sinon.stub().returns({});
});
afterEach(function() {
clock.uninstall();
sandbox.restore();
});
function mkEvents() {