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
This commit is contained in:
dakkar 2025-06-10 16:09:22 +01:00
parent 31e21d4d7d
commit 363fb4db3a

View file

@ -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);
});
});