import { mochaRun } from '../../../util/helpers.js'; import { ForumTest } from '../forum.test-util.js'; describe('Forum', function tests() { this.timeout(0); const forumTest = new ForumTest(); before(async () => { await forumTest.setup(); }); context('Negative citation of a weaker negative citation', async () => { it('Post4', async () => { const { forum, experts, posts } = forumTest; await forumTest.addPost(experts[0], 10); forum.getPost(posts[0]).value.should.equal(10); }); it('Post5 negatively cites Post4', async () => { const { forum, experts, posts } = forumTest; await forumTest.addPost(experts[0], 10, [{ postId: posts[0], weight: -0.5 }]); forum.getPost(posts[0]).value.should.equal(5); forum.getPost(posts[1]).value.should.equal(15); }); it('Post6 negatively cites Post5, restoring Post4 post to its initial value', async () => { const { forum, experts, posts } = forumTest; await forumTest.addPost(experts[0], 20, [{ postId: posts[1], weight: -1 }]); forum.getPost(posts[0]).value.should.equal(10); forum.getPost(posts[1]).value.should.equal(0); forum.getPost(posts[2]).value.should.equal(30); }); }); }); // await addPost(experts[0], 10); // await addPost(experts[0], 10, [{ postId: posts[3], weight: -1 }]); // await addPost(experts[0], 10, [{ postId: posts[4], weight: -1 }]); // await addPost(expert3, 'Post 4', 100, [{ postId: postId2, weight: -1 }]); // await addPost(expert1, 'Post 5', 100, [{ postId: postId3, weight: -1 }]); mochaRun();