mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-19 02:50:53 +01:00
test: intify uid/cid if they are numbers (when getting crossposts)
This commit is contained in:
@@ -27,6 +27,9 @@ Crossposts.get = async function (tid) {
|
|||||||
crossposts = crossposts.map((crosspost, idx) => {
|
crossposts = crossposts.map((crosspost, idx) => {
|
||||||
crosspost.id = crosspostIds[idx];
|
crosspost.id = crosspostIds[idx];
|
||||||
crosspost.category = categoriesData.get(parseInt(crosspost.cid, 10));
|
crosspost.category = categoriesData.get(parseInt(crosspost.cid, 10));
|
||||||
|
crosspost.uid = utils.isNumber(crosspost.uid) ? parseInt(crosspost.uid) : crosspost.uid;
|
||||||
|
crosspost.cid = utils.isNumber(crosspost.cid) ? parseInt(crosspost.cid) : crosspost.cid;
|
||||||
|
|
||||||
return crosspost;
|
return crosspost;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -396,9 +396,9 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
tid: actual.tid,
|
tid: actual.tid,
|
||||||
cid: actual.cid,
|
cid: actual.cid,
|
||||||
}, {
|
}, {
|
||||||
uid: '0',
|
uid: 0,
|
||||||
tid,
|
tid,
|
||||||
cid: String(cid),
|
cid: cid,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -443,9 +443,9 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
tid: actual.tid,
|
tid: actual.tid,
|
||||||
cid: actual.cid,
|
cid: actual.cid,
|
||||||
}, {
|
}, {
|
||||||
uid: '0',
|
uid: 0,
|
||||||
tid,
|
tid,
|
||||||
cid: String(cid),
|
cid: cid,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user