From b8f6d58d99a18edca84c66326f2f9bbf06ec7c8b Mon Sep 17 00:00:00 2001 From: Myx Date: Wed, 29 Apr 2026 19:05:38 +0200 Subject: [PATCH] test: repair broken tests --- e2e/tests/plugins/plugin-api-two-users.spec.ts | 2 +- e2e/tests/plugins/plugin-manager-ui.spec.ts | 4 ++-- server/src/migrations/1000000000009-ServerIcons.ts | 2 +- .../feature/plugin-page-host/plugin-page-host.component.html | 2 +- .../feature/server-search/server-search.component.ts | 4 +--- .../app/infrastructure/realtime/realtime-session.service.ts | 5 +++++ 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/e2e/tests/plugins/plugin-api-two-users.spec.ts b/e2e/tests/plugins/plugin-api-two-users.spec.ts index 02ab548..ee26bc7 100644 --- a/e2e/tests/plugins/plugin-api-two-users.spec.ts +++ b/e2e/tests/plugins/plugin-api-two-users.spec.ts @@ -141,7 +141,7 @@ async function registerUser(page: Page, username: string, displayName: string): } async function installGrantAndActivatePlugin(page: Page, installFromStore: boolean): Promise { - 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 }); diff --git a/e2e/tests/plugins/plugin-manager-ui.spec.ts b/e2e/tests/plugins/plugin-manager-ui.spec.ts index 35eb154..5910fd8 100644 --- a/e2e/tests/plugins/plugin-manager-ui.spec.ts +++ b/e2e/tests/plugins/plugin-manager-ui.spec.ts @@ -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 }); }); diff --git a/server/src/migrations/1000000000009-ServerIcons.ts b/server/src/migrations/1000000000009-ServerIcons.ts index 79bbb19..8d24ed1 100644 --- a/server/src/migrations/1000000000009-ServerIcons.ts +++ b/server/src/migrations/1000000000009-ServerIcons.ts @@ -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"`); } -} \ No newline at end of file +} diff --git a/toju-app/src/app/domains/plugins/feature/plugin-page-host/plugin-page-host.component.html b/toju-app/src/app/domains/plugins/feature/plugin-page-host/plugin-page-host.component.html index 13b6933..c25d82c 100644 --- a/toju-app/src/app/domains/plugins/feature/plugin-page-host/plugin-page-host.component.html +++ b/toju-app/src/app/domains/plugins/feature/plugin-page-host/plugin-page-host.component.html @@ -14,4 +14,4 @@

The plugin page is not registered or the plugin is not loaded.

} - \ No newline at end of file + diff --git a/toju-app/src/app/domains/server-directory/feature/server-search/server-search.component.ts b/toju-app/src/app/domains/server-directory/feature/server-search/server-search.component.ts index 3308c23..0b0b14c 100644 --- a/toju-app/src/app/domains/server-directory/feature/server-search/server-search.component.ts +++ b/toju-app/src/app/domains/server-directory/feature/server-search/server-search.component.ts @@ -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 */ } diff --git a/toju-app/src/app/infrastructure/realtime/realtime-session.service.ts b/toju-app/src/app/infrastructure/realtime/realtime-session.service.ts index a1db6ec..0a4eea1 100644 --- a/toju-app/src/app/infrastructure/realtime/realtime-session.service.ts +++ b/toju-app/src/app/infrastructure/realtime/realtime-session.service.ts @@ -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): boolean { + return this.signalingTransportHandler.sendRawMessageToSignalUrl(signalUrl, message); + } + /** * Track the currently-active server ID (for server-scoped operations). *