From 363fb4db3af43f7d698c253333cb749f8a7d61c0 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 10 Jun 2025 16:09:22 +0100 Subject: [PATCH] fix streaming e2e test the test I toggled said: * ayako follows kyoko, withReplies:false * kyoko posts a reply to kanako * ayako is looking at the global timeline * ayako will see kyoko's reply but I'm pretty sure we don't want that, so the test was wrong for Sharkey and the backend behaviour is correct --- packages/backend/test/e2e/streaming.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/backend/test/e2e/streaming.ts b/packages/backend/test/e2e/streaming.ts index 38a826c4d3..89e88d6d6c 100644 --- a/packages/backend/test/e2e/streaming.ts +++ b/packages/backend/test/e2e/streaming.ts @@ -8,6 +8,7 @@ process.env.NODE_ENV = 'test'; import * as assert from 'assert'; import { WebSocket } from 'ws'; import { MiFollowing } from '@/models/Following.js'; +import { MiInstance } from '@/models/Instance.js'; import { api, createAppToken, initTestDb, port, post, signup, waitFire } from '../utils.js'; import type * as misskey from 'misskey-js'; @@ -49,6 +50,12 @@ describe('Streaming', () => { beforeAll(async () => { const connection = await initTestDb(true); Followings = connection.getRepository(MiFollowing); + const instances = connection.getRepository(MiInstance); + await instances.insert({ + id: 'aaaaaa', + host: 'example.com', + firstRetrievedAt: new Date(), + }); ayano = await signup({ username: 'ayano' }); kyoko = await signup({ username: 'kyoko' }); @@ -572,14 +579,14 @@ describe('Streaming', () => { assert.strictEqual(fired, false); }); - test('withReplies = falseでフォローしてる人によるリプライが流れてくる', async () => { + test('withReplies = falseでフォローしてる人によるリプライが流れてくない', async () => { const fired = await waitFire( ayano, 'globalTimeline', // ayano:Global () => api('notes/create', { text: 'foo', replyId: kanakoNote.id }, kyoko), // kyoko posts msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko ); - assert.strictEqual(fired, true); + assert.strictEqual(fired, false); }); });