summaryrefslogtreecommitdiff
path: root/spec/javascripts/diffs
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-09-18 16:27:53 +0100
committerPhil Hughes <me@iamphill.com>2018-09-18 16:27:53 +0100
commit90673dbcb82f78c53d071994ca65e3ace7a28f62 (patch)
tree2eda6d72e31126eb60b74e17a6c8625021643893 /spec/javascripts/diffs
parentc48f0c1aed8f6a0db43afb27ad5f3cc13f09dedc (diff)
downloadgitlab-ce-90673dbcb82f78c53d071994ca65e3ace7a28f62.tar.gz
Changed isDiscussionApplicableToLine to accept an object
Diffstat (limited to 'spec/javascripts/diffs')
-rw-r--r--spec/javascripts/diffs/store/utils_spec.js36
1 files changed, 22 insertions, 14 deletions
diff --git a/spec/javascripts/diffs/store/utils_spec.js b/spec/javascripts/diffs/store/utils_spec.js
index cb712463e12..6138b9701f4 100644
--- a/spec/javascripts/diffs/store/utils_spec.js
+++ b/spec/javascripts/diffs/store/utils_spec.js
@@ -350,13 +350,21 @@ describe('DiffsStoreUtils', () => {
it('returns true when the discussion is up to date', () => {
expect(
- utils.isDiscussionApplicableToLine(discussions.upToDateDiscussion1, diffPosition, true),
+ utils.isDiscussionApplicableToLine({
+ discussion: discussions.upToDateDiscussion1,
+ diffPosition,
+ latestDiff: true,
+ }),
).toBe(true);
});
it('returns false when the discussion is not up to date', () => {
expect(
- utils.isDiscussionApplicableToLine(discussions.outDatedDiscussion1, diffPosition, true),
+ utils.isDiscussionApplicableToLine({
+ discussion: discussions.outDatedDiscussion1,
+ diffPosition,
+ latestDiff: true,
+ }),
).toBe(false);
});
@@ -366,14 +374,14 @@ describe('DiffsStoreUtils', () => {
delete discussion.position;
expect(
- utils.isDiscussionApplicableToLine(
+ utils.isDiscussionApplicableToLine({
discussion,
- {
+ diffPosition: {
...diffPosition,
lineCode: 'ABC_1',
},
- true,
- ),
+ latestDiff: true,
+ }),
).toBe(false);
});
@@ -383,14 +391,14 @@ describe('DiffsStoreUtils', () => {
delete discussion.position;
expect(
- utils.isDiscussionApplicableToLine(
+ utils.isDiscussionApplicableToLine({
discussion,
- {
+ diffPosition: {
...diffPosition,
lineCode: 'ABC_1',
},
- true,
- ),
+ latestDiff: true,
+ }),
).toBe(true);
});
@@ -400,14 +408,14 @@ describe('DiffsStoreUtils', () => {
delete discussion.position;
expect(
- utils.isDiscussionApplicableToLine(
+ utils.isDiscussionApplicableToLine({
discussion,
- {
+ diffPosition: {
...diffPosition,
lineCode: 'ABC_1',
},
- false,
- ),
+ latestDiff: false,
+ }),
).toBe(false);
});
});