mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
Add test
This commit is contained in:
parent
a4257c0c60
commit
be11afc9b9
1 changed files with 25 additions and 0 deletions
|
@ -484,6 +484,31 @@ describe('Streaming', () => {
|
|||
});
|
||||
}));
|
||||
|
||||
it('フォローしているユーザーのホーム投稿が流れる', () => new Promise(async done => {
|
||||
const alice = await signup({ username: 'alice' });
|
||||
const bob = await signup({ username: 'bob' });
|
||||
|
||||
// Alice が Bob をフォロー
|
||||
await request('/following/create', {
|
||||
userId: bob.id
|
||||
}, alice);
|
||||
|
||||
const ws = await connectStream(alice, 'hybridTimeline', ({ type, body }) => {
|
||||
if (type == 'note') {
|
||||
assert.deepStrictEqual(body.userId, bob.id);
|
||||
assert.deepStrictEqual(body.text, 'foo');
|
||||
ws.close();
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
// ホーム投稿
|
||||
post(bob, {
|
||||
text: 'foo',
|
||||
visibility: 'home'
|
||||
});
|
||||
}));
|
||||
|
||||
it('フォローしていないローカルユーザーのホーム投稿は流れない', () => new Promise(async done => {
|
||||
const alice = await signup({ username: 'alice' });
|
||||
const bob = await signup({ username: 'bob' });
|
||||
|
|
Loading…
Reference in a new issue