mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 01:26:12 +02:00
test: add test for #13729
This commit is contained in:
BIN
test/files/测试.jpg
Normal file
BIN
test/files/测试.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1010 B |
@@ -194,6 +194,12 @@ describe('Upload Controllers', () => {
|
||||
assert(body.response.images[0].url);
|
||||
});
|
||||
|
||||
it('should upload a file with utf8 characters in the name to a post', async () => {
|
||||
const { body } = await helpers.uploadFile(`${nconf.get('url')}/api/post/upload`, path.join(__dirname, '../test/files/测试.jpg'), {}, jar, csrf_token);
|
||||
|
||||
assert(body.response.images[0].url.endsWith('测试.jpg'));
|
||||
});
|
||||
|
||||
it('should fail to upload image to post if image dimensions are too big', async () => {
|
||||
const { response, body } = await helpers.uploadFile(`${nconf.get('url')}/api/post/upload`, path.join(__dirname, '../test/files/toobig.png'), {}, jar, csrf_token);
|
||||
assert.strictEqual(response.statusCode, 500);
|
||||
|
||||
Reference in New Issue
Block a user