From 2004d5e2f85650dfffb69372e72218f38fe49363 Mon Sep 17 00:00:00 2001 From: Daiki Mizukami Date: Sat, 9 Nov 2024 18:31:41 +0900 Subject: [PATCH] test(backend): add federation test for `publicReactions` --- .../backend/test-federation/test/user.test.ts | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/backend/test-federation/test/user.test.ts b/packages/backend/test-federation/test/user.test.ts index 76605e61d4..df6f8c10e0 100644 --- a/packages/backend/test-federation/test/user.test.ts +++ b/packages/backend/test-federation/test/user.test.ts @@ -43,12 +43,11 @@ describe('User', () => { 'uri', 'createdAt', 'lastFetchedAt', - 'publicReactions', ]); }); }); - describe('ffVisibility is federated', () => { + describe('ff/reactions visibility is federated', () => { let alice: LoginUser, bob: LoginUser; let bobInA: Misskey.entities.UserDetailedNotMe, aliceInB: Misskey.entities.UserDetailedNotMe; @@ -78,6 +77,7 @@ describe('User', () => { ])) { strictEqual(user.followersVisibility, 'public'); strictEqual(user.followingVisibility, 'public'); + strictEqual(user.publicReactions, true); } }); @@ -113,6 +113,22 @@ describe('User', () => { strictEqual(user.followingVisibility, 'private'); } }); + + test('Setting false for publicReactions is federated', async () => { + await Promise.all([ + alice.client.request('i/update', { publicReactions: false }), + bob.client.request('i/update', { publicReactions: false }), + ]); + await sleep(); + + for (const user of await Promise.all([ + alice.client.request('users/show', { userId: bobInA.id }), + bob.client.request('users/show', { userId: aliceInB.id }), + ])) { + strictEqual(user.publicReactions, false); + strictEqual(user.publicReactions, false); + } + }); }); describe('isCat is federated', () => {