mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-20 08:29:55 +02:00
test: stop using partialDeepStrictEqual for now
This commit is contained in:
@@ -89,7 +89,13 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
|
|
||||||
assert(Array.isArray(crossposts));
|
assert(Array.isArray(crossposts));
|
||||||
assert.strictEqual(crossposts.length, 1);
|
assert.strictEqual(crossposts.length, 1);
|
||||||
assert.partialDeepStrictEqual(crossposts[0], {
|
|
||||||
|
const actual = crossposts[0];
|
||||||
|
assert.deepStrictEqual({
|
||||||
|
uid: actual.uid,
|
||||||
|
tid: actual.tid,
|
||||||
|
cid: actual.cid,
|
||||||
|
}, {
|
||||||
uid,
|
uid,
|
||||||
tid,
|
tid,
|
||||||
cid: cid2,
|
cid: cid2,
|
||||||
@@ -365,7 +371,6 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
|
|
||||||
// Mock a group follow/accept
|
// Mock a group follow/accept
|
||||||
const timestamp = Date.now();
|
const timestamp = Date.now();
|
||||||
console.log('saving', remoteCid);
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.sortedSetAdd(`cid:${cid}:following`, timestamp, remoteCid),
|
db.sortedSetAdd(`cid:${cid}:following`, timestamp, remoteCid),
|
||||||
db.sortedSetAdd(`followersRemote:${remoteCid}`, timestamp, `cid|${cid}`),
|
db.sortedSetAdd(`followersRemote:${remoteCid}`, timestamp, `cid|${cid}`),
|
||||||
@@ -384,7 +389,13 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
const crossposts = await topics.crossposts.get(tid);
|
const crossposts = await topics.crossposts.get(tid);
|
||||||
|
|
||||||
assert.strictEqual(crossposts.length, 1);
|
assert.strictEqual(crossposts.length, 1);
|
||||||
assert.partialDeepStrictEqual(crossposts[0], {
|
|
||||||
|
const actual = crossposts[0];
|
||||||
|
assert.deepStrictEqual({
|
||||||
|
uid: actual.uid,
|
||||||
|
tid: actual.tid,
|
||||||
|
cid: actual.cid,
|
||||||
|
}, {
|
||||||
uid: '0',
|
uid: '0',
|
||||||
tid,
|
tid,
|
||||||
cid: String(cid),
|
cid: String(cid),
|
||||||
@@ -425,7 +436,13 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
const tid = await posts.getPostField(pid, 'tid');
|
const tid = await posts.getPostField(pid, 'tid');
|
||||||
const crossposts = await topics.crossposts.get(tid);
|
const crossposts = await topics.crossposts.get(tid);
|
||||||
assert.strictEqual(crossposts.length, 1);
|
assert.strictEqual(crossposts.length, 1);
|
||||||
assert.partialDeepStrictEqual(crossposts[0], {
|
|
||||||
|
const actual = crossposts[0];
|
||||||
|
assert.deepStrictEqual({
|
||||||
|
uid: actual.uid,
|
||||||
|
tid: actual.tid,
|
||||||
|
cid: actual.cid,
|
||||||
|
}, {
|
||||||
uid: '0',
|
uid: '0',
|
||||||
tid,
|
tid,
|
||||||
cid: String(cid),
|
cid: String(cid),
|
||||||
@@ -497,7 +514,13 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
assert.strictEqual(activitypub._sent.size, 1);
|
assert.strictEqual(activitypub._sent.size, 1);
|
||||||
assert.partialDeepStrictEqual(Array.from(activitypub._sent).pop()[1], {
|
|
||||||
|
const actual = Array.from(activitypub._sent).pop()[1];
|
||||||
|
assert.deepStrictEqual({
|
||||||
|
type: actual.type,
|
||||||
|
actor: actual.actor,
|
||||||
|
object: actual.object,
|
||||||
|
}, {
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
actor: `${nconf.get('url')}/category/${cid1}`,
|
actor: `${nconf.get('url')}/category/${cid1}`,
|
||||||
object: activity,
|
object: activity,
|
||||||
@@ -513,7 +536,13 @@ describe('Crossposting (& related logic)', () => {
|
|||||||
await activitypub.inbox.like({ body });
|
await activitypub.inbox.like({ body });
|
||||||
|
|
||||||
assert.strictEqual(activitypub._sent.size, 1);
|
assert.strictEqual(activitypub._sent.size, 1);
|
||||||
assert.partialDeepStrictEqual(Array.from(activitypub._sent).pop()[1], {
|
|
||||||
|
const actual = Array.from(activitypub._sent).pop()[1];
|
||||||
|
assert.deepStrictEqual({
|
||||||
|
type: actual.type,
|
||||||
|
actor: actual.actor,
|
||||||
|
object: actual.object,
|
||||||
|
}, {
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
actor: `${nconf.get('url')}/category/${cid1}`,
|
actor: `${nconf.get('url')}/category/${cid1}`,
|
||||||
object: body,
|
object: body,
|
||||||
|
|||||||
Reference in New Issue
Block a user