test: Add 8 people voice tests

This commit is contained in:
2026-04-18 14:19:59 +02:00
parent bd21568726
commit 167c45ba8d
17 changed files with 2044 additions and 232 deletions

View File

@@ -61,6 +61,8 @@
[class.hover:text-foreground/80]="activeChannelId() !== ch.id"
(click)="selectTextChannel(ch.id)"
(contextmenu)="openChannelContextMenu($event, ch)"
data-channel-type="text"
[attr.data-channel-name]="ch.name"
>
<span class="text-muted-foreground text-base">#</span>
@if (renamingChannelId() === ch.id) {
@@ -129,6 +131,8 @@
[class.bg-secondary]="isCurrentRoom(ch.id)"
[disabled]="!voiceEnabled()"
[title]="isCurrentRoom(ch.id) ? 'Open stream workspace' : 'Join voice channel'"
data-channel-type="voice"
[attr.data-channel-name]="ch.name"
>
<span class="flex items-center gap-2 text-foreground/80">
<ng-icon

View File

@@ -559,23 +559,32 @@ export class RoomsSidePanelComponent {
const current = this.currentUser();
if (this.openExistingVoiceWorkspace(room, current ?? null, roomId)) {
this.voiceConnection.clearConnectionError();
return;
}
if (!room || !this.canJoinRequestedVoiceRoom(room, current ?? null, roomId)) {
if (!room) {
this.voiceConnection.reportConnectionError('No active room selected for voice join.');
return;
}
if (!this.canJoinRequestedVoiceRoom(room, current ?? null, roomId)) {
this.voiceConnection.reportConnectionError('You do not have permission to join this voice channel.');
return;
}
if (!this.prepareCrossServerVoiceJoin(room, current ?? null)) {
this.voiceConnection.reportConnectionError('Disconnect from the current voice server before joining a different server.');
return;
}
this.enableVoiceForJoin(room, current ?? null, roomId)
.then(() => this.onVoiceJoinSucceeded(roomId, room, current ?? null))
.catch(() => undefined);
.catch((error) => this.handleVoiceJoinFailure(error));
}
private onVoiceJoinSucceeded(roomId: string, room: Room, current: User | null): void {
this.voiceConnection.clearConnectionError();
this.updateVoiceStateStore(roomId, room, current);
this.trackCurrentUserMic();
this.startVoiceHeartbeat(roomId, room);
@@ -583,6 +592,14 @@ export class RoomsSidePanelComponent {
this.startVoiceSession(roomId, room);
}
private handleVoiceJoinFailure(error: unknown): void {
const message = error instanceof Error
? error.message
: 'Failed to join voice channel.';
this.voiceConnection.reportConnectionError(message);
}
private trackCurrentUserMic(): void {
const userId = this.currentUser()?.oderId || this.currentUser()?.id;
const micStream = this.voiceConnection.getRawMicStream();