refactor: tab rules

This commit is contained in:
Barış Soner Uşaklı
2021-11-18 16:42:18 -05:00
parent c26870d227
commit fb363957d1
69 changed files with 128 additions and 175 deletions

View File

@@ -243,54 +243,6 @@ describe('Upload Controllers', () => {
});
});
// it('should fail if topic thumbs are disabled', function (done) {
// helpers.uploadFile(
// nconf.get('url') + '/api/topic/thumb/upload',
// path.join(__dirname, '../test/files/test.png'),
// {}, jar, csrf_token,
// function (err, res, body) {
// assert.ifError(err);
// assert.strictEqual(res.statusCode, 404);
// console.log(body);
// assert(body && body.status && body.status.code);
// assert.strictEqual(body.status.code, '[[error:topic-thumbnails-are-disabled]]');
// done();
// }
// );
// });
// it('should fail if file is not image', function (done) {
// meta.config.allowTopicsThumbnail = 1;
// helpers.uploadFile(
// nconf.get('url') + '/api/topic/thumb/upload',
// path.join(__dirname, '../test/files/503.html'),
// {}, jar, csrf_token,
// function (err, res, body) {
// assert.ifError(err);
// assert.equal(res.statusCode, 500);
// assert.equal(body.error, '[[error:invalid-file]]');
// done();
// }
// );
// });
// it('should upload topic thumb', function (done) {
// meta.config.allowTopicsThumbnail = 1;
// helpers.uploadFile(
// nconf.get('url') + '/api/topic/thumb/upload',
// path.join(__dirname, '../test/files/test.png'),
// {}, jar, csrf_token,
// function (err, res, body) {
// assert.ifError(err);
// assert.equal(res.statusCode, 200);
// assert(Array.isArray(body));
// assert(body[0].path);
// assert(body[0].url);
// done();
// }
// );
// });
it('should not allow non image uploads', (done) => {
socketUser.updateCover({ uid: 1 }, { uid: 1, file: { path: '../../text.txt' } }, (err) => {
assert.equal(err.message, '[[error:invalid-data]]');