mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-27 13:43:07 +02:00
add tests
This commit is contained in:
parent
854ac95511
commit
26b7112b20
1 changed files with 26 additions and 0 deletions
|
@ -1034,6 +1034,32 @@ describe('Timelines', () => {
|
|||
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
|
||||
});
|
||||
|
||||
test.concurrent('[withChannelNotes: true] 他人が取得した場合センシティブチャンネル投稿が含まれない', async () => {
|
||||
const [alice, bob] = await Promise.all([signup(), signup()]);
|
||||
|
||||
const channel = await api('/channels/create', { name: 'channel', isSensitive: true }, bob).then(x => x.body);
|
||||
const bobNote = await post(bob, { text: 'hi', channelId: channel.id });
|
||||
|
||||
await waitForPushToTl();
|
||||
|
||||
const res = await api('/users/notes', { userId: bob.id, withChannelNotes: true }, alice);
|
||||
|
||||
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false);
|
||||
});
|
||||
|
||||
test.concurrent('[withChannelNotes: true] 自分が取得した場合センシティブチャンネル投稿が含まれる', async () => {
|
||||
const [bob] = await Promise.all([signup()]);
|
||||
|
||||
const channel = await api('/channels/create', { name: 'channel', isSensitive: true }, bob).then(x => x.body);
|
||||
const bobNote = await post(bob, { text: 'hi', channelId: channel.id });
|
||||
|
||||
await waitForPushToTl();
|
||||
|
||||
const res = await api('/users/notes', { userId: bob.id, withChannelNotes: true }, bob);
|
||||
|
||||
assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true);
|
||||
});
|
||||
|
||||
test.concurrent('ミュートしているユーザーに関連する投稿が含まれない', async () => {
|
||||
const [alice, bob, carol] = await Promise.all([signup(), signup(), signup()]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue