1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-30 04:23:07 +03:00

typing events don't need to be in an array

This commit is contained in:
Kegan Dougal
2022-11-21 11:31:33 +00:00
parent 78de55b835
commit acc488da64
2 changed files with 21 additions and 29 deletions

View File

@ -866,27 +866,23 @@ describe("SlidingSyncSdk", () => {
expect(room.getMember(selfUserId)?.typing).toEqual(false);
ext.onResponse({
rooms: {
[roomId]: [
{
type: EventType.Typing,
content: {
user_ids: [selfUserId],
},
[roomId]: {
type: EventType.Typing,
content: {
user_ids: [selfUserId],
},
],
},
},
});
expect(room.getMember(selfUserId)?.typing).toEqual(true);
ext.onResponse({
rooms: {
[roomId]: [
{
type: EventType.Typing,
content: {
user_ids: [],
},
[roomId]: {
type: EventType.Typing,
content: {
user_ids: [],
},
],
},
},
});
expect(room.getMember(selfUserId)?.typing).toEqual(false);
@ -910,27 +906,23 @@ describe("SlidingSyncSdk", () => {
expect(room.getMember(selfUserId)?.typing).toEqual(false);
ext.onResponse({
rooms: {
[roomId]: [
{
type: EventType.Typing,
content: {
user_ids: ["@someone:else"],
},
[roomId]: {
type: EventType.Typing,
content: {
user_ids: ["@someone:else"],
},
],
},
},
});
expect(room.getMember(selfUserId)?.typing).toEqual(false);
ext.onResponse({
rooms: {
"!something:else": [
{
type: EventType.Typing,
content: {
user_ids: [selfUserId],
},
"!something:else": {
type: EventType.Typing,
content: {
user_ids: [selfUserId],
},
],
},
},
});
expect(room.getMember(selfUserId)?.typing).toEqual(false);