test: repair broken tests

This commit is contained in:
2026-04-29 19:05:38 +02:00
parent e1ac1d1bc0
commit b8f6d58d99
6 changed files with 11 additions and 8 deletions

View File

@@ -141,7 +141,7 @@ async function registerUser(page: Page, username: string, displayName: string):
}
async function installGrantAndActivatePlugin(page: Page, installFromStore: boolean): Promise<void> {
await page.getByRole('button', { name: 'Plugins' }).click();
await page.getByRole('button', { name: 'Plugin Store' }).click();
await expect(page).toHaveURL(/\/plugin-store/, { timeout: 20_000 });
await expect(page.getByTestId('plugin-store-page')).toBeVisible({ timeout: 20_000 });

View File

@@ -23,8 +23,8 @@ test.describe('Plugin manager UI', () => {
await expect(page).toHaveURL(/\/room\//, { timeout: 30_000 });
});
await test.step('Open visible Plugins button', async () => {
await page.getByRole('button', { name: 'Plugins' }).click();
await test.step('Open visible Plugin Store button', async () => {
await page.getByRole('button', { name: 'Plugin Store' }).click();
await expect(page).toHaveURL(/\/plugin-store/, { timeout: 10_000 });
await expect(page.getByTestId('plugin-store-page')).toBeVisible({ timeout: 10_000 });
});

View File

@@ -28,4 +28,4 @@ export class ServerIcons1000000000009 implements MigrationInterface {
await queryRunner.query(`DROP TABLE "servers"`);
await queryRunner.query(`ALTER TABLE "servers_without_icons" RENAME TO "servers"`);
}
}
}

View File

@@ -14,4 +14,4 @@
<p class="mt-2 text-sm text-muted-foreground">The plugin page is not registered or the plugin is not loaded.</p>
</section>
}
</main>
</main>

View File

@@ -415,13 +415,11 @@ export class ServerSearchComponent implements OnInit {
description: currentUser.description,
profileUpdatedAt: currentUser.profileUpdatedAt
});
this.webrtc.joinRoom(server.id, currentUser.oderId || currentUser.id, wsUrl);
this.webrtc.sendRawMessage({
this.webrtc.sendRawMessageToSignalUrl(wsUrl, {
type: 'server_icon_sync_request',
serverId: server.id,
iconUpdatedAt: 0
});
window.setTimeout(() => this.webrtc.leaveRoom(server.id), 15_000);
} catch {
/* discovery icons are best-effort */
}

View File

@@ -304,6 +304,11 @@ export class WebRTCService implements OnDestroy {
this.signalingTransportHandler.sendRawMessage(message);
}
/** Send a raw JSON payload through a specific signaling WebSocket. */
sendRawMessageToSignalUrl(signalUrl: string, message: Record<string, unknown>): boolean {
return this.signalingTransportHandler.sendRawMessageToSignalUrl(signalUrl, message);
}
/**
* Track the currently-active server ID (for server-scoped operations).
*