Added test of a currently failing scenario
This commit is contained in:
parent
e26afa1eb4
commit
23070ae381
|
@ -86,15 +86,44 @@ async function setup() {
|
|||
// }
|
||||
}
|
||||
|
||||
describe('Negative citation of a negative citation', async () => {
|
||||
describe('Forum', () => {
|
||||
before(async () => {
|
||||
await setup();
|
||||
await addPost(experts[0], 10);
|
||||
await addPost(experts[0], 10, [{ postId: posts[0], weight: -1 }]);
|
||||
await addPost(experts[0], 10, [{ postId: posts[1], weight: -1 }]);
|
||||
});
|
||||
it('Should restore original post to its initial value', () => {
|
||||
forum.getPost(posts[0]).value.should.equal(10);
|
||||
context('Negative citation of a negative citation with max strength', async () => {
|
||||
it('Post1', async () => {
|
||||
await addPost(experts[0], 10);
|
||||
forum.getPost(posts[0]).value.should.equal(10);
|
||||
});
|
||||
it('Post2 negatively cites Post1', async () => {
|
||||
await addPost(experts[0], 10, [{ postId: posts[0], weight: -1 }]);
|
||||
forum.getPost(posts[0]).value.should.equal(0);
|
||||
forum.getPost(posts[1]).value.should.equal(20);
|
||||
});
|
||||
it('Post3 negatively cites Post2, restoring Post1 post to its initial value', async () => {
|
||||
await addPost(experts[0], 10, [{ 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(20);
|
||||
});
|
||||
});
|
||||
|
||||
context('Negative citation of a weaker negative citation', async () => {
|
||||
it('Post4', async () => {
|
||||
await addPost(experts[0], 10);
|
||||
forum.getPost(posts[3]).value.should.equal(10);
|
||||
});
|
||||
it('Post5 negatively cites Post4', async () => {
|
||||
await addPost(experts[0], 10, [{ postId: posts[3], weight: -0.5 }]);
|
||||
forum.getPost(posts[3]).value.should.equal(5);
|
||||
forum.getPost(posts[4]).value.should.equal(15);
|
||||
});
|
||||
it('Post6 negatively cites Post5, restoring Post4 post to its initial value', async () => {
|
||||
await addPost(experts[0], 20, [{ postId: posts[4], weight: -1 }]);
|
||||
forum.getPost(posts[3]).value.should.equal(10);
|
||||
forum.getPost(posts[4]).value.should.equal(0);
|
||||
forum.getPost(posts[5]).value.should.equal(30);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue