Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-03-10 17:59:58 -04:00
2 changed files with 89 additions and 4 deletions

View File

@@ -400,6 +400,17 @@ describe('Upload Controllers', () => {
assert.strictEqual(body.error, '[[error:invalid-path]]');
});
it('should fail to upload regular file if directory does not exist', async () => {
const { response, body } = await helpers.uploadFile(`${nconf.get('url')}/api/admin/upload/file`, path.join(__dirname, '../test/files/test.png'), {
params: JSON.stringify({
folder: 'does-not-exist',
}),
}, jar, csrf_token);
assert.equal(response.statusCode, 500);
assert.strictEqual(body.error, '[[error:invalid-path]]');
});
describe('ACP uploads screen', () => {
it('should create a folder', async () => {
const { response } = await helpers.createFolder('', 'myfolder', jar, csrf_token);