fix test/e2e/blocks.ts

by adding a note visibility check on the backend
This commit is contained in:
dakkar 2025-05-13 15:29:38 +01:00
parent 76b5ec5264
commit bc1cd86b10
2 changed files with 4 additions and 2 deletions

View file

@ -302,6 +302,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.noSuchRenoteTarget);
} else if (isRenote(renote) && !isQuote(renote)) {
throw new ApiError(meta.errors.cannotReRenote);
} else if (!await this.noteEntityService.isVisibleForMe(renote, me.id)) {
throw new ApiError(meta.errors.cannotRenoteDueToVisibility);
}
// Check blocking

View file

@ -53,7 +53,7 @@ describe('Block', () => {
assert.strictEqual(res.status, 400);
assert.ok(res.body);
assert.strictEqual(castAsError(res.body).error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3');
assert.strictEqual(castAsError(res.body).error.id, 'b98980fa-3780-406c-a935-b6d0eeee10d1');
});
test('ブロックされているユーザーのートをRenoteできない', async () => {
@ -62,7 +62,7 @@ describe('Block', () => {
const res = await api('notes/create', { renoteId: note.id, text: 'yo' }, bob);
assert.strictEqual(res.status, 400);
assert.strictEqual(castAsError(res.body).error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3');
assert.strictEqual(castAsError(res.body).error.id, 'be9529e9-fe72-4de0-ae43-0b363c4938af');
});
// TODO: ユーザーリストに入れられないテスト