snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
56
tests/specs/moderation/grantModerator.spec.ts
Normal file
56
tests/specs/moderation/grantModerator.spec.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { Participant } from '../../helpers/Participant';
|
||||
import { setTestProperties } from '../../helpers/TestProperties';
|
||||
import { expectations } from '../../helpers/expectations';
|
||||
import { ensureOneParticipant, ensureTwoParticipants } from '../../helpers/participants';
|
||||
|
||||
setTestProperties(__filename, {
|
||||
description: 'This test checks the ability of a moderator to grant the "moderator" role to another participant. The\
|
||||
test is skipped when the "allModerators" expectation is set.',
|
||||
usesBrowsers: [ 'p1', 'p2' ]
|
||||
});
|
||||
|
||||
describe('Grant moderator', () => {
|
||||
let p1: Participant, p2: Participant;
|
||||
|
||||
it('setup', async () => {
|
||||
if (expectations.moderation.allModerators) {
|
||||
ctx.skipSuiteTests = 'allModerators is expected';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
await ensureOneParticipant();
|
||||
p1 = ctx.p1;
|
||||
expect(await p1.isModerator()).toBe(true);
|
||||
|
||||
const grantOwnerType = await p1.execute(() => typeof APP.conference._room.grantOwner);
|
||||
const functionAvailable = grantOwnerType === 'function';
|
||||
|
||||
if (expectations.moderation.grantModerator) {
|
||||
expect(grantOwnerType).toBe('function');
|
||||
} else {
|
||||
if (!functionAvailable) {
|
||||
ctx.skipSuiteTests = 'grantModerator is not available and not expected';
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await ensureTwoParticipants();
|
||||
p2 = ctx.p2;
|
||||
expect(await p2.isModerator()).toBe(false);
|
||||
});
|
||||
|
||||
it('grant moderator', async () => {
|
||||
await p1.getFilmstrip().grantModerator(p2);
|
||||
|
||||
await p2.driver.waitUntil(
|
||||
() => p2.isModerator(),
|
||||
{
|
||||
timeout: 3000,
|
||||
timeoutMsg: 'p2 did not become moderator'
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user