fix(backend/test): MisskeyIO#437 によりテストが失敗する問題を修正 (MisskeyIO#440)

This commit is contained in:
まっちゃとーにゅ 2024-02-12 07:40:57 +09:00 committed by GitHub
parent 0df6dbd919
commit 0d5ddc2406
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -665,7 +665,7 @@ describe('Note', () => {
assert.strictEqual(note2.body.error.code, 'CONTAINS_PROHIBITED_WORDS');
});
test('禁止ワードを含んでいてもリモートノートはエラーにならない', async () => {
test('禁止ワードを含む投稿はエラーになる (リモート)', async () => {
const prohibited = await api('admin/update-meta', {
prohibitedWords: [
'test',
@ -676,11 +676,12 @@ describe('Note', () => {
await new Promise(x => setTimeout(x, 2));
const note1 = await api('/notes/create', {
const note3 = await api('/notes/create', {
text: 'hogetesthuge',
}, tom);
assert.strictEqual(note1.status, 200);
assert.strictEqual(note3.status, 400);
assert.strictEqual(note3.body.error.code, 'CONTAINS_PROHIBITED_WORDS');
});
});

View File

@ -100,6 +100,7 @@ describe('ActivityPub', () => {
perRemoteUserUserTimelineCacheMax: 100,
blockedHosts: [] as string[],
sensitiveWords: [] as string[],
prohibitedWords: [] as string[],
} as MiMeta;
let meta = metaInitial;