Merge pull request #283 from matrix-org/rav/issue_1427

Fix bug which stopped us scrolling down after we scrolled up
This commit is contained in:
Richard van der Hoff 2016-04-21 14:26:42 +01:00
commit 30f273c611
3 changed files with 89 additions and 5 deletions

View file

@ -43,8 +43,8 @@ module.exports.stubClient = function() {
sendReadReceipt: sinon.stub().returns(q()),
};
// create the peg
// stub out the methods in MatrixClientPeg
//
// 'sandbox.restore()' doesn't work correctly on inherited methods,
// so we do this for each method
var methods = ['get', 'unset', 'replaceUsingUrls',
@ -52,7 +52,9 @@ module.exports.stubClient = function() {
for (var i = 0; i < methods.length; i++) {
sandbox.stub(peg, methods[i]);
}
peg.get.returns(client);
// MatrixClientPeg.get() is called a /lot/, so implement it with our own
// fast stub function rather than a sinon stub
peg.get = function() { return client; };
return sandbox;
}