Added specs to isDiscussionApplicableToLine
It now tests for the latest diff check
This commit is contained in:
parent
5c39c7c3b9
commit
c48f0c1aed
1 changed files with 35 additions and 10 deletions
|
@ -350,13 +350,13 @@ describe('DiffsStoreUtils', () => {
|
||||||
|
|
||||||
it('returns true when the discussion is up to date', () => {
|
it('returns true when the discussion is up to date', () => {
|
||||||
expect(
|
expect(
|
||||||
utils.isDiscussionApplicableToLine(discussions.upToDateDiscussion1, diffPosition),
|
utils.isDiscussionApplicableToLine(discussions.upToDateDiscussion1, diffPosition, true),
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false when the discussion is not up to date', () => {
|
it('returns false when the discussion is not up to date', () => {
|
||||||
expect(
|
expect(
|
||||||
utils.isDiscussionApplicableToLine(discussions.outDatedDiscussion1, diffPosition),
|
utils.isDiscussionApplicableToLine(discussions.outDatedDiscussion1, diffPosition, true),
|
||||||
).toBe(false);
|
).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -366,10 +366,14 @@ describe('DiffsStoreUtils', () => {
|
||||||
delete discussion.position;
|
delete discussion.position;
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
utils.isDiscussionApplicableToLine(discussion, {
|
utils.isDiscussionApplicableToLine(
|
||||||
|
discussion,
|
||||||
|
{
|
||||||
...diffPosition,
|
...diffPosition,
|
||||||
lineCode: 'ABC_1',
|
lineCode: 'ABC_1',
|
||||||
}),
|
},
|
||||||
|
true,
|
||||||
|
),
|
||||||
).toBe(false);
|
).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -379,11 +383,32 @@ describe('DiffsStoreUtils', () => {
|
||||||
delete discussion.position;
|
delete discussion.position;
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
utils.isDiscussionApplicableToLine(discussion, {
|
utils.isDiscussionApplicableToLine(
|
||||||
|
discussion,
|
||||||
|
{
|
||||||
...diffPosition,
|
...diffPosition,
|
||||||
lineCode: 'ABC_1',
|
lineCode: 'ABC_1',
|
||||||
}),
|
},
|
||||||
|
true,
|
||||||
|
),
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('returns false when not latest diff', () => {
|
||||||
|
const discussion = { ...discussions.outDatedDiscussion1, line_code: 'ABC_1', active: true };
|
||||||
|
delete discussion.original_position;
|
||||||
|
delete discussion.position;
|
||||||
|
|
||||||
|
expect(
|
||||||
|
utils.isDiscussionApplicableToLine(
|
||||||
|
discussion,
|
||||||
|
{
|
||||||
|
...diffPosition,
|
||||||
|
lineCode: 'ABC_1',
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
),
|
||||||
|
).toBe(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue