mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
ESlint object-curly-spacing
This commit is contained in:
20
test/meta.js
20
test/meta.js
@@ -36,7 +36,7 @@ describe('meta', function () {
|
||||
describe('settings', function () {
|
||||
var socketAdmin = require('../src/socket.io/admin');
|
||||
it('it should set setting', function (done) {
|
||||
socketAdmin.settings.set({uid: fooUid}, {hash: 'some:hash', values: {foo: '1', derp: 'value'}}, function (err) {
|
||||
socketAdmin.settings.set({ uid: fooUid }, { hash: 'some:hash', values: { foo: '1', derp: 'value' } }, function (err) {
|
||||
assert.ifError(err);
|
||||
db.getObject('settings:some:hash', function (err, data) {
|
||||
assert.ifError(err);
|
||||
@@ -48,7 +48,7 @@ describe('meta', function () {
|
||||
});
|
||||
|
||||
it('it should get setting', function (done) {
|
||||
socketAdmin.settings.get({uid: fooUid}, {hash: 'some:hash'}, function (err, data) {
|
||||
socketAdmin.settings.get({ uid: fooUid }, { hash: 'some:hash' }, function (err, data) {
|
||||
assert.ifError(err);
|
||||
assert.equal(data.foo, '1');
|
||||
assert.equal(data.derp, 'value');
|
||||
@@ -57,7 +57,7 @@ describe('meta', function () {
|
||||
});
|
||||
|
||||
it('should not set setting if not empty', function (done) {
|
||||
meta.settings.setOnEmpty('some:hash', {foo: 2}, function (err) {
|
||||
meta.settings.setOnEmpty('some:hash', { foo: 2 }, function (err) {
|
||||
assert.ifError(err);
|
||||
db.getObject('settings:some:hash', function (err, data) {
|
||||
assert.ifError(err);
|
||||
@@ -69,7 +69,7 @@ describe('meta', function () {
|
||||
});
|
||||
|
||||
it('should set setting if empty', function (done) {
|
||||
meta.settings.setOnEmpty('some:hash', {empty: '2'}, function (err) {
|
||||
meta.settings.setOnEmpty('some:hash', { empty: '2' }, function (err) {
|
||||
assert.ifError(err);
|
||||
db.getObject('settings:some:hash', function (err, data) {
|
||||
assert.ifError(err);
|
||||
@@ -97,7 +97,7 @@ describe('meta', function () {
|
||||
describe('config', function () {
|
||||
var socketAdmin = require('../src/socket.io/admin');
|
||||
before(function (done) {
|
||||
db.setObject('config', {minimumTagLength: 3, maximumTagLength: 15}, done);
|
||||
db.setObject('config', { minimumTagLength: 3, maximumTagLength: 15 }, done);
|
||||
});
|
||||
|
||||
it('should get config fields', function (done) {
|
||||
@@ -117,7 +117,7 @@ describe('meta', function () {
|
||||
});
|
||||
|
||||
it('should fail if data is invalid', function (done) {
|
||||
socketAdmin.config.set({uid: fooUid}, null, function (err) {
|
||||
socketAdmin.config.set({ uid: fooUid }, null, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-data]]');
|
||||
done();
|
||||
});
|
||||
@@ -135,14 +135,14 @@ describe('meta', function () {
|
||||
});
|
||||
|
||||
it('should fail if data is invalid', function (done) {
|
||||
socketAdmin.config.setMultiple({uid: fooUid}, null, function (err) {
|
||||
socketAdmin.config.setMultiple({ uid: fooUid }, null, function (err) {
|
||||
assert.equal(err.message, '[[error:invalid-data]]');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should set multiple values', function (done) {
|
||||
socketAdmin.config.setMultiple({uid: fooUid}, {
|
||||
socketAdmin.config.setMultiple({ uid: fooUid }, {
|
||||
someField1: 'someValue1',
|
||||
someField2: 'someValue2',
|
||||
customCSS: '.derp{color:#00ff00;}',
|
||||
@@ -158,7 +158,7 @@ describe('meta', function () {
|
||||
});
|
||||
|
||||
it('should not set config if not empty', function (done) {
|
||||
meta.configs.setOnEmpty({someField1: 'foo'}, function (err) {
|
||||
meta.configs.setOnEmpty({ someField1: 'foo' }, function (err) {
|
||||
assert.ifError(err);
|
||||
db.getObjectField('config', 'someField1', function (err, value) {
|
||||
assert.ifError(err);
|
||||
@@ -169,7 +169,7 @@ describe('meta', function () {
|
||||
});
|
||||
|
||||
it('should remove config field', function (done) {
|
||||
socketAdmin.config.remove({uid: fooUid}, 'someField1', function (err) {
|
||||
socketAdmin.config.remove({ uid: fooUid }, 'someField1', function (err) {
|
||||
assert.ifError(err);
|
||||
db.isObjectField('config', 'someField1', function (err, isObjectField) {
|
||||
assert.ifError(err);
|
||||
|
||||
Reference in New Issue
Block a user