mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 19:26:04 +03:00
Fix last active test
Time is backwards from all the other tests: larger is older, so we want LessThanOrEqual. Also ensure all the power levels are the same to prevent the sort algorithm from running a PL ordering.
This commit is contained in:
parent
34d5870a03
commit
f59625f7bd
1 changed files with 4 additions and 1 deletions
|
@ -170,7 +170,7 @@ describe('MemberList', () => {
|
|||
if (!groupChange) {
|
||||
if (isPresenceEnabled) {
|
||||
console.log("Comparing last active timestamp...");
|
||||
expect(userB.getLastActiveTs()).toBeGreaterThanOrEqual(userA.getLastActiveTs());
|
||||
expect(userB.getLastActiveTs()).toBeLessThanOrEqual(userA.getLastActiveTs());
|
||||
groupChange = userA.getLastActiveTs() !== userB.getLastActiveTs();
|
||||
} else {
|
||||
console.log("Skipping last active timestamp");
|
||||
|
@ -245,14 +245,17 @@ describe('MemberList', () => {
|
|||
const semiActiveUsers = [adminUsers[0]];
|
||||
const inactiveUsers = [...moderatorUsers, ...adminUsers.slice(1), ...defaultUsers.slice(1)];
|
||||
activeUsers.forEach((u) => {
|
||||
u.powerLevel = 100; // set everyone to the same PL to avoid running that check
|
||||
u.user.lastPresenceTs = 1000;
|
||||
u.user.lastActiveAgo = 0;
|
||||
});
|
||||
semiActiveUsers.forEach((u) => {
|
||||
u.powerLevel = 100;
|
||||
u.user.lastPresenceTs = 1000;
|
||||
u.user.lastActiveAgo = 50;
|
||||
});
|
||||
inactiveUsers.forEach((u) => {
|
||||
u.powerLevel = 100;
|
||||
u.user.lastPresenceTs = 1000;
|
||||
u.user.lastActiveAgo = 100;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue