snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
42
tests/specs/moderation/moderation.spec.ts
Normal file
42
tests/specs/moderation/moderation.spec.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Participant } from '../../helpers/Participant';
|
||||
import { setTestProperties } from '../../helpers/TestProperties';
|
||||
import { config as testsConfig } from '../../helpers/TestsConfig';
|
||||
import { expectations } from '../../helpers/expectations';
|
||||
import { joinMuc } from '../../helpers/joinMuc';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
description: 'This test asserts that participants have the expected role ("moderator" or not). Failures here\
|
||||
most likely indicate that the environment or test framework is misconfigured.',
|
||||
usesBrowsers: [ 'p1', 'p2' ]
|
||||
});
|
||||
|
||||
// Just make sure that users are given moderator rights as specified in the expectations config.
|
||||
describe('Moderation', () => {
|
||||
let p1: Participant, p2: Participant;
|
||||
|
||||
it('setup', async () => {
|
||||
p1 = await joinMuc({ name: 'p1', token: testsConfig.jwt.preconfiguredToken });
|
||||
p2 = await joinMuc({ name: 'p2', token: testsConfig.jwt.preconfiguredToken });
|
||||
});
|
||||
it('first moderator', async () => {
|
||||
if (expectations.moderation.firstModerator) {
|
||||
expect(await p1.isModerator()).toBe(true);
|
||||
} else {
|
||||
expect(await p1.isModerator()).toBe(false);
|
||||
}
|
||||
});
|
||||
it('all moderators', async () => {
|
||||
if (expectations.moderation.allModerators) {
|
||||
expect(await p1.isModerator()).toBe(true);
|
||||
expect(await p2.isModerator()).toBe(true);
|
||||
}
|
||||
});
|
||||
it('auto moderator promotion', async () => {
|
||||
if (expectations.moderation.autoModerator && !expectations.moderation.allModerators) {
|
||||
expect(await p1.isModerator()).toBe(true);
|
||||
expect(await p2.isModerator()).toBe(false);
|
||||
await p1.hangup();
|
||||
await p2.driver.waitUntil(async () => (await p2.isModerator()));
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user