1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-23 22:42:10 +03:00

Test tghat Session.logged_out is fired

This commit is contained in:
David Baker
2016-03-15 14:50:37 +00:00
parent 9f91995f4e
commit 39a5765888

View File

@@ -279,6 +279,24 @@ describe("MatrixClient events", function() {
done();
});
});
it("should emit Session.logged_out on M_UNKNOWN_TOKEN", function(done) {
httpBackend.when("GET", "/sync").respond(401, { errcode: 'M_UNKNOWN_TOKEN' });
var sessionLoggedOutCount = 0;
client.on("Session.logged_out", function(event, member) {
sessionLoggedOutCount++;
});
client.startClient();
httpBackend.flush().done(function() {
expect(sessionLoggedOutCount).toEqual(
1, "Session.logged_out fired wrong number of times"
);
done();
});
});
});
});