Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net committed Sep 24, 2024
1 parent 2c7974b commit 5cdb8a1
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions packages/backend/test/e2e/search-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ describe('検索', () => {
fileIds: [sensitive1.id, sensitive2.id],
});

daveNote = await post(dave, { text: 'ff_test', visibility: 'followers' });
daveNoteDirect = await post(dave, { text: 'ff_test', visibility: 'specified', visibleUserIds: [] });
daveNote = await post(dave, { text: 'example', visibility: 'followers' });
daveNoteDirect = await post(dave, { text: 'example', visibility: 'specified', visibleUserIds: [] });

tomNote = await post(tom, { text: 'ff_test', visibility: 'followers' });
tomNoteDirect = await post(tom, { text: '@alice ff_test', visibility: 'specified', visibleUserIds: [alice.id] });
await api('following/create', { userId: tom.id }, alice);
tomNote = await post(tom, { text: 'example', visibility: 'followers' });
tomNoteDirect = await post(tom, { text: '@alice example', visibility: 'specified', visibleUserIds: [alice.id] });

reactedNote = await post(carol, { text: 'indexable_text' });
votedNote = await post(carol, {
Expand Down Expand Up @@ -212,6 +213,20 @@ describe('検索', () => {
assert.strictEqual(Array.isArray(res.body), true);
assert.strictEqual(res.body.length, 3);
});
test('可視性 followers, specified', async() => {
const asres0 = await api('notes/advanced-search', {
query: 'example',
}, alice);
assert.strictEqual(asres0.status, 200);
assert.strictEqual(Array.isArray(asres0.body), true);

const ids = asres0.body.map((x) => x.id);
assert.strictEqual(ids.includes(tomNote.id), true);
assert.strictEqual(ids.includes(tomNoteDirect.id), true);
assert.strictEqual(ids.includes(daveNote.id), false);
assert.strictEqual(ids.includes(daveNoteDirect.id), false);
assert.strictEqual(asres0.body.length, 2);
});
test('ミュートしてたら出ない', async() => {
const asres0 = await api('notes/advanced-search', {
query: 'muting',
Expand Down

0 comments on commit 5cdb8a1

Please sign in to comment.