fix(server): 単純にrenoteできないのを修正

This commit is contained in:
tamaina 2023-02-26 11:10:24 +00:00
parent a56898df94
commit 02d7ffd305
2 changed files with 16 additions and 0 deletions

View File

@ -235,6 +235,21 @@ describe('api:notes/create', () => {
});
});
describe('renote', () => {
test('just a renote', () => {
expect(v({ renoteId: '1' }))
.toBe(VALID);
});
test('just a quote', () => {
expect(v({ text: 'Hello, world!', renoteId: '1' }))
.toBe(VALID);
});
test('reject invalid renoteId', () => {
expect(v({ renoteId: 'あ' }))
.toBe(INVALID);
});
});
test('text, fileIds and poll', () => {
expect(v({ text: 'Hello, world!', fileIds: ['1', '2', '3'], poll: { choices: ['a', 'b', 'c'] } }))
.toBe(VALID);

View File

@ -147,6 +147,7 @@ export const paramDef = {
// (re)note with text, files and poll are optional
anyOf: [
{ required: ['text'] },
{ required: ['renoteId'] },
{ required: ['fileIds'] },
{ required: ['mediaIds'] },
{ required: ['poll'] },