test: fix most e2e tests

This commit is contained in:
2026-06-11 10:21:28 +02:00
parent 1671a04f03
commit b630bacdc6
9 changed files with 230 additions and 36 deletions

View File

@@ -18,7 +18,8 @@ import {
import {
authHeaders,
readAuthTokenFromPage,
registerTestUser
registerTestUser,
type AuthSession
} from '../../helpers/auth-api';
import { RegisterPage } from '../../pages/register.page';
import { ServerSearchPage } from '../../pages/server-search.page';
@@ -151,6 +152,12 @@ test.describe('Mixed signal-config voice', () => {
});
let secondaryRoomId = '';
// Identity that owns the secondary room. The invite must be created with
// this same API session: client 0 also auto-provisions a *separate*
// identity on the secondary signal endpoint, which overwrites the page's
// stored token, so reading the token back from the page would yield a
// non-owner identity and the invite request would be rejected (NOT_MEMBER).
let secondaryRoomOwner: AuthSession;
// ── Create rooms ────────────────────────────────────────────
await test.step('Create voice room on primary and chat room on secondary', async () => {
@@ -192,6 +199,7 @@ test.describe('Mixed signal-config voice', () => {
);
secondaryRoomId = secondaryRoom.id;
secondaryRoomOwner = secondarySession;
});
// ── Create invite links ─────────────────────────────────────
@@ -221,17 +229,14 @@ test.describe('Mixed signal-config voice', () => {
primaryRoomInviteUrl = `/invite/${primaryInvite.id}?server=${encodeURIComponent(testServer.url)}`;
// Create invite for secondary room (chat) via API
const secondaryToken = await readAuthTokenFromPage(clients[0].page, secondaryServer.url);
if (!secondaryToken) {
throw new Error('Missing session token for secondary signal invite creation');
}
// Create invite for secondary room (chat) via API using the API session
// that owns the room. The page-stored token for the secondary endpoint
// belongs to client 0's auto-provisioned identity, which is not the
// room owner and would be rejected with NOT_MEMBER.
const secondaryInvite = await createInviteViaApi(
secondaryServer.url,
secondaryRoomId,
secondaryToken,
secondaryRoomOwner.token,
clients[0].user.displayName
);