more accurate test name and also test >=

This commit is contained in:
Bruno Windels 2021-06-17 09:59:24 +02:00
parent 099f99a96b
commit bf84b59e39

View file

@ -98,7 +98,8 @@ export function tests() {
const eventsPowerLevelEvent = {content: { const eventsPowerLevelEvent = {content: {
events_default: 5, events_default: 5,
events: { events: {
"m.room.message": 45 "m.room.message": 45,
"m.room.topic": 50,
}, },
users: { users: {
[alice]: 50, [alice]: 50,
@ -138,9 +139,10 @@ export function tests() {
assert.equal(pl.canSendType("m.foo"), true); assert.equal(pl.canSendType("m.foo"), true);
assert.equal(pl.canSendType("m.room.message"), false); assert.equal(pl.canSendType("m.room.message"), false);
}, },
"can send event below events[type]": assert => { "can send event above or at events[type]": assert => {
const pl = new PowerLevels({powerLevelEvent: eventsPowerLevelEvent, ownUserId: alice}); const pl = new PowerLevels({powerLevelEvent: eventsPowerLevelEvent, ownUserId: alice});
assert.equal(pl.canSendType("m.room.message"), true); assert.equal(pl.canSendType("m.room.message"), true);
assert.equal(pl.canSendType("m.room.topic"), true);
}, },
} }
} }