mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
test: fix broken test
This commit is contained in:
@@ -131,7 +131,6 @@ Categories.getModeratorUids = async function (cids) {
|
|||||||
|
|
||||||
return _.uniq(sets.uids[index].concat(_.flatten(sets.groupNames[index].map(g => map[g]))));
|
return _.uniq(sets.uids[index].concat(_.flatten(sets.groupNames[index].map(g => map[g]))));
|
||||||
});
|
});
|
||||||
console.log('what', moderatorUids);
|
|
||||||
return moderatorUids;
|
return moderatorUids;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ const cache = require('../cache');
|
|||||||
module.exports = function (Categories) {
|
module.exports = function (Categories) {
|
||||||
Categories.update = async function (modified) {
|
Categories.update = async function (modified) {
|
||||||
const cids = Object.keys(modified);
|
const cids = Object.keys(modified);
|
||||||
console.log('updating', cids);
|
|
||||||
await Promise.all(cids.map(cid => updateCategory(cid, modified[cid])));
|
await Promise.all(cids.map(cid => updateCategory(cid, modified[cid])));
|
||||||
return cids;
|
return cids;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -826,7 +826,7 @@ describe('Categories', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.only('Categories.getModeratorUids', () => {
|
describe('Categories.getModeratorUids', () => {
|
||||||
let cid;
|
let cid;
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
@@ -865,7 +865,8 @@ describe('Categories', () => {
|
|||||||
const payload = {};
|
const payload = {};
|
||||||
payload[cid] = { disabled: 1 };
|
payload[cid] = { disabled: 1 };
|
||||||
await Categories.update(payload);
|
await Categories.update(payload);
|
||||||
const uids = await Categories.getModeratorUids([1, 2]);
|
const uids = await Categories.getModeratorUids([cid, 2]);
|
||||||
|
console.log(uids);
|
||||||
assert(!uids[0].includes('1'));
|
assert(!uids[0].includes('1'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user