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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
305ce570
Commit
305ce570
authored
Sep 20, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for adding `truncated_diff_lines` to discussion
parent
eb2b933c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+35
-0
No files found.
spec/javascripts/notes/stores/mutation_spec.js
View file @
305ce570
...
@@ -156,6 +156,41 @@ describe('Notes Store mutations', () => {
...
@@ -156,6 +156,41 @@ describe('Notes Store mutations', () => {
expect
(
state
.
discussions
[
2
].
notes
[
0
].
note
).
toBe
(
legacyNote
.
notes
[
1
].
note
);
expect
(
state
.
discussions
[
2
].
notes
[
0
].
note
).
toBe
(
legacyNote
.
notes
[
1
].
note
);
expect
(
state
.
discussions
.
length
).
toEqual
(
3
);
expect
(
state
.
discussions
.
length
).
toEqual
(
3
);
});
});
it
(
'
adds truncated_diff_lines if discussion is a diffFile
'
,
()
=>
{
const
state
=
{
discussions
:
[],
};
mutations
.
SET_INITIAL_DISCUSSIONS
(
state
,
[
{
...
note
,
diff_file
:
{
file_hash
:
'
a
'
,
},
truncated_diff_lines
:
[
'
a
'
],
},
]);
expect
(
state
.
discussions
[
0
].
truncated_diff_lines
).
toEqual
([
'
a
'
]);
});
it
(
'
adds empty truncated_diff_lines when not in discussion
'
,
()
=>
{
const
state
=
{
discussions
:
[],
};
mutations
.
SET_INITIAL_DISCUSSIONS
(
state
,
[
{
...
note
,
diff_file
:
{
file_hash
:
'
a
'
,
},
},
]);
expect
(
state
.
discussions
[
0
].
truncated_diff_lines
).
toEqual
([]);
});
});
});
describe
(
'
SET_LAST_FETCHED_AT
'
,
()
=>
{
describe
(
'
SET_LAST_FETCHED_AT
'
,
()
=>
{
...
...
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