summaryrefslogtreecommitdiff
path: root/packages/backend/test/e2e
diff options
context:
space:
mode:
authorzyoshoka <107108195+zyoshoka@users.noreply.github.com>2024-01-08 17:40:37 +0900
committerGitHub <noreply@github.com>2024-01-08 17:40:37 +0900
commit618e2ba1d22f57efca25e5a4b2c1f0bea0e5ea21 (patch)
treef211f5ee7728c8c241f2a41f74c218e62b20bc7d /packages/backend/test/e2e
parentrefactor(frontend): router.ts解きほぐし (#12907) (diff)
downloadsharkey-618e2ba1d22f57efca25e5a4b2c1f0bea0e5ea21.tar.gz
sharkey-618e2ba1d22f57efca25e5a4b2c1f0bea0e5ea21.tar.bz2
sharkey-618e2ba1d22f57efca25e5a4b2c1f0bea0e5ea21.zip
fix(backend): `drive/files/update`におけるファイル名のバリデーションが機能していない問題を修正 (#12923)
* fix(backend): `drive/files/update`におけるファイル名のバリデーションが機能していない問題を修正 * Update CHANGELOG.md * refactor: `!== undefined` -> `!= null` * add test
Diffstat (limited to 'packages/backend/test/e2e')
-rw-r--r--packages/backend/test/e2e/endpoints.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/backend/test/e2e/endpoints.ts b/packages/backend/test/e2e/endpoints.ts
index bfd0b0272d..d75549c816 100644
--- a/packages/backend/test/e2e/endpoints.ts
+++ b/packages/backend/test/e2e/endpoints.ts
@@ -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',