You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
Fix c+p fail & add unit test
This commit is contained in:
@@ -536,7 +536,7 @@ module.exports = Room;
|
||||
* Fires whenever a receipt is received for a room
|
||||
* @event module:client~MatrixClient#"Room.receipt"
|
||||
* @param {event} event The receipt event
|
||||
* @param {Room} room The room whose Room.name was updated.
|
||||
* @param {Room} room The room whose receipts was updated.
|
||||
* @example
|
||||
* matrixClient.on("Room.receipt", function(event, room){
|
||||
* var receiptContent = event.getContent();
|
||||
|
||||
@@ -684,6 +684,21 @@ describe("Room", function() {
|
||||
}]);
|
||||
});
|
||||
|
||||
it("should emit an event when a receipt is added",
|
||||
function() {
|
||||
var listener = jasmine.createSpy('spy');
|
||||
room.on("Room.receipt", listener);
|
||||
|
||||
var ts = 13787898424;
|
||||
|
||||
var receiptEvent = mkReceipt(roomId, [
|
||||
mkRecord(eventToAck.getId(), "m.read", userB, ts)
|
||||
]);
|
||||
|
||||
room.addReceipt(receiptEvent);
|
||||
expect(listener).toHaveBeenCalledWith(receiptEvent, room);
|
||||
});
|
||||
|
||||
it("should clobber receipts based on type and user ID", function() {
|
||||
var nextEventToAck = utils.mkMessage({
|
||||
room: roomId, user: userA, msg: "I AM HERE YOU KNOW",
|
||||
|
||||
Reference in New Issue
Block a user