From 3238f60780fbef8900e28196b59896fce196c5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Tue, 26 Mar 2019 19:15:59 +0900 Subject: [PATCH] Update api.ts --- test/api.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/api.ts b/test/api.ts index 85f376793..cc4521d3d 100644 --- a/test/api.ts +++ b/test/api.ts @@ -1141,6 +1141,20 @@ describe('API', () => { expect(res).have.status(400); })); + it('フォルダが循環するような構造にできない(自身)', async(async () => { + const arisugawa = await signup({ username: 'arisugawa' }); + const folderA = (await request('/drive/folders/create', { + name: 'test' + }, arisugawa)).body; + + const res = await request('/drive/folders/update', { + folderId: folderA.id, + parentId: folderA.id + }, arisugawa); + + expect(res).have.status(400); + })); + it('存在しない親フォルダを設定できない', async(async () => { const alice = await signup({ username: 'alice' }); const folder = (await request('/drive/folders/create', {