add failing test

This commit is contained in:
Bruno Windels 2021-08-26 15:16:51 +02:00
parent 25d0cbe9a2
commit d0c1ddb51b

View file

@ -243,6 +243,17 @@ export function tests() {
assert.equal(change.member.membership, "join"); assert.equal(change.member.membership, "join");
assert.equal(txn.members.get(alice).displayName, "Alice"); assert.equal(txn.members.get(alice).displayName, "Alice");
}, },
"new join through both timeline and state": async assert => {
const writer = new MemberWriter(roomId);
const txn = createStorage();
const aliceJoin = createMemberEvent("join", alice, "Alice");
const change = await writer.writeStateMemberEvent(aliceJoin, false, txn);
assert(!change.hasJoined);
assert(!change.hasLeft);
const timelineChange = await writer.writeTimelineMemberEvent(aliceJoin, txn);
assert(change.hasJoined);
assert(!change.hasLeft);
},
"newly joined member causes a change with lookup done first": async assert => { "newly joined member causes a change with lookup done first": async assert => {
const event = createMemberEvent("join", alice, "Alice"); const event = createMemberEvent("join", alice, "Alice");
const writer = new MemberWriter(roomId); const writer = new MemberWriter(roomId);