Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c48f0c1a
Commit
c48f0c1a
authored
Sep 17, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specs to isDiscussionApplicableToLine
It now tests for the latest diff check
parent
5c39c7c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
spec/javascripts/diffs/store/utils_spec.js
spec/javascripts/diffs/store/utils_spec.js
+35
-10
No files found.
spec/javascripts/diffs/store/utils_spec.js
View file @
c48f0c1a
...
@@ -350,13 +350,13 @@ describe('DiffsStoreUtils', () => {
...
@@ -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', () => {
...
@@ -366,10 +366,14 @@ describe('DiffsStoreUtils', () => {
delete
discussion
.
position
;
delete
discussion
.
position
;
expect
(
expect
(
utils
.
isDiscussionApplicableToLine
(
discussion
,
{
utils
.
isDiscussionApplicableToLine
(
...
diffPosition
,
discussion
,
lineCode
:
'
ABC_1
'
,
{
}),
...
diffPosition
,
lineCode
:
'
ABC_1
'
,
},
true
,
),
).
toBe
(
false
);
).
toBe
(
false
);
});
});
...
@@ -379,11 +383,32 @@ describe('DiffsStoreUtils', () => {
...
@@ -379,11 +383,32 @@ describe('DiffsStoreUtils', () => {
delete
discussion
.
position
;
delete
discussion
.
position
;
expect
(
expect
(
utils
.
isDiscussionApplicableToLine
(
discussion
,
{
utils
.
isDiscussionApplicableToLine
(
...
diffPosition
,
discussion
,
lineCode
:
'
ABC_1
'
,
{
}),
...
diffPosition
,
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
);
});
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment