You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-06-27 15:01:53 +03:00
Make tests pass on Chrome again
It seems that a number of the tests had started failing when run in Chrome. They were fine under PhantomJS, but the MegolmExport tests only work under Chrome, and I need them to work... Mostly the problems were timing-related, where assumptions made about how quickly the `then` handler on a promise would be called were no longer valid. Possibly Chrome 55 has made some changes to the relative priorities of setTimeout and sendMessage calls. One of the TimelinePanel tests was failing because it was expecting the contents of a div to take up more room than they actually were. It's possible this is something very environment-specific; hopefully the new value will work on a wider range of machines. Also some logging tweaks.
This commit is contained in:
@ -42,17 +42,12 @@ describe('RoomView', function () {
|
||||
it('resolves a room alias to a room id', function (done) {
|
||||
peg.get().getRoomIdForAlias.returns(q({room_id: "!randomcharacters:aser.ver"}));
|
||||
|
||||
var onRoomIdResolved = sinon.spy();
|
||||
function onRoomIdResolved(room_id) {
|
||||
expect(room_id).toEqual("!randomcharacters:aser.ver");
|
||||
done();
|
||||
}
|
||||
|
||||
ReactDOM.render(<RoomView roomAddress="#alias:ser.ver" onRoomIdResolved={onRoomIdResolved} />, parentDiv);
|
||||
|
||||
process.nextTick(function() {
|
||||
// These expect()s don't read very well and don't give very good failure
|
||||
// messages, but expect's toHaveBeenCalled only takes an expect spy object,
|
||||
// not a sinon spy object.
|
||||
expect(onRoomIdResolved.called).toExist();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('joins by alias if given an alias', function (done) {
|
||||
|
Reference in New Issue
Block a user