mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
refactor: tab rules
This commit is contained in:
@@ -146,7 +146,7 @@
|
||||
"@commitlint/config-angular": "14.1.0",
|
||||
"coveralls": "3.1.1",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-nodebb": "0.0.3",
|
||||
"eslint-config-nodebb": "0.1.1",
|
||||
"eslint-plugin-import": "2.25.3",
|
||||
"grunt": "1.4.1",
|
||||
"grunt-contrib-watch": "1.1.0",
|
||||
|
||||
@@ -21,7 +21,7 @@ privilegesController.get = async function (req, res) {
|
||||
name: '[[admin/manage/privileges:global]]',
|
||||
icon: 'fa-list',
|
||||
}, {
|
||||
cid: 'admin', // what do?
|
||||
cid: 'admin',
|
||||
name: '[[admin/manage/privileges:admin]]',
|
||||
icon: 'fa-lock',
|
||||
}];
|
||||
|
||||
@@ -388,7 +388,9 @@ authenticationController.onSuccessfulLogin = async function (req, uid) {
|
||||
version: req.useragent.version,
|
||||
});
|
||||
await Promise.all([
|
||||
new Promise(resolve => req.session.save(resolve)),
|
||||
new Promise((resolve) => {
|
||||
req.session.save(resolve);
|
||||
}),
|
||||
user.auth.addSession(uid, req.sessionID),
|
||||
user.updateLastOnlineTime(uid),
|
||||
user.updateOnlineUsers(uid),
|
||||
|
||||
@@ -137,9 +137,7 @@ Auth.reloadRoutes = async function (params) {
|
||||
res.locals.strategy = strategy;
|
||||
next();
|
||||
})(req, res, next);
|
||||
},
|
||||
Auth.middleware.validateAuth,
|
||||
(req, res, next) => {
|
||||
}, Auth.middleware.validateAuth, (req, res, next) => {
|
||||
async.waterfall([
|
||||
async.apply(req.login.bind(req), res.locals.user),
|
||||
async.apply(controllers.authentication.onSuccessfulLogin, req, req.uid),
|
||||
|
||||
@@ -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]]');
|
||||
|
||||
@@ -259,6 +259,7 @@ describe('Utility Methods', () => {
|
||||
});
|
||||
|
||||
it('should return passed in value if invalid', (done) => {
|
||||
// eslint-disable-next-line no-loss-of-precision
|
||||
const bigInt = -111111111111111111;
|
||||
const result = utils.toISOString(bigInt);
|
||||
assert.equal(bigInt, result);
|
||||
|
||||
Reference in New Issue
Block a user