fix(backend): drive/files/update
におけるファイル名のバリデーションが機能していない問題を修正 (#12923)
* fix(backend): `drive/files/update`におけるファイル名のバリデーションが機能していない問題を修正 * Update CHANGELOG.md * refactor: `!== undefined` -> `!= null` * add test
This commit is contained in:
parent
04f9147db6
commit
618e2ba1d2
3 changed files with 14 additions and 1 deletions
|
@ -710,6 +710,18 @@ describe('Endpoints', () => {
|
|||
assert.strictEqual(res.status, 400);
|
||||
});
|
||||
|
||||
test('不正なファイル名で怒られる', async () => {
|
||||
const file = (await uploadFile(alice)).body;
|
||||
const newName = '';
|
||||
|
||||
const res = await api('/drive/files/update', {
|
||||
fileId: file.id,
|
||||
name: newName,
|
||||
}, alice);
|
||||
|
||||
assert.strictEqual(res.status, 400);
|
||||
});
|
||||
|
||||
test('間違ったIDで怒られる', async () => {
|
||||
const res = await api('/drive/files/update', {
|
||||
fileId: 'kyoppie',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue