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
253d9814
Commit
253d9814
authored
Dec 11, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-12-11
parents
cab246ad
97ba7735
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
28 deletions
+50
-28
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+1
-1
changelogs/unreleased/55138-fix-mr-discussions-count.yml
changelogs/unreleased/55138-fix-mr-discussions-count.yml
+5
-0
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+44
-27
No files found.
app/assets/javascripts/notes/stores/mutations.js
View file @
253d9814
...
...
@@ -246,7 +246,7 @@ export default {
discussion
=>
!
discussion
.
individual_note
&&
discussion
.
resolvable
&&
discussion
.
notes
.
some
(
note
=>
!
note
.
resolved
),
discussion
.
notes
.
some
(
note
=>
note
.
resolvable
&&
!
note
.
resolved
),
).
length
;
state
.
hasUnresolvedDiscussions
=
state
.
unresolvedDiscussionsCount
>
1
;
},
...
...
changelogs/unreleased/55138-fix-mr-discussions-count.yml
0 → 100644
View file @
253d9814
---
title
:
Fix MR resolved discussion counts being too low
merge_request
:
23710
author
:
type
:
fixed
spec/javascripts/notes/stores/mutation_spec.js
View file @
253d9814
...
...
@@ -9,6 +9,11 @@ import {
individualNote
,
}
from
'
../mock_data
'
;
const
RESOLVED_NOTE
=
{
resolvable
:
true
,
resolved
:
true
};
const
UNRESOLVED_NOTE
=
{
resolvable
:
true
,
resolved
:
false
};
const
SYSTEM_NOTE
=
{
resolvable
:
false
,
resolved
:
false
};
const
WEIRD_NOTE
=
{
resolvable
:
false
,
resolved
:
true
};
describe
(
'
Notes Store mutations
'
,
()
=>
{
describe
(
'
ADD_NEW_NOTE
'
,
()
=>
{
let
state
;
...
...
@@ -449,49 +454,61 @@ describe('Notes Store mutations', () => {
});
describe
(
'
UPDATE_RESOLVABLE_DISCUSSIONS_COUNTS
'
,
()
=>
{
it
(
'
updates resolvableDiscussionsCount
'
,
()
=>
{
const
state
=
{
discussions
:
[
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[]
},
{
individual_note
:
true
,
resolvable
:
true
,
notes
:
[]
},
{
individual_note
:
false
,
resolvable
:
false
,
notes
:
[]
},
],
resolvableDiscussionsCount
:
0
,
};
mutations
.
UPDATE_RESOLVABLE_DISCUSSIONS_COUNTS
(
state
);
expect
(
state
.
resolvableDiscussionsCount
).
toBe
(
1
);
});
it
(
'
updates unresolvedDiscussionsCount
'
,
()
=>
{
it
(
'
with unresolvable discussions, updates state
'
,
()
=>
{
const
state
=
{
discussions
:
[
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[
{
resolved
:
false
}
]
},
{
individual_note
:
true
,
resolvable
:
true
,
notes
:
[
{
resolved
:
false
}
]
},
{
individual_note
:
false
,
resolvable
:
false
,
notes
:
[
{
resolved
:
false
}
]
},
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[
UNRESOLVED_NOTE
]
},
{
individual_note
:
true
,
resolvable
:
true
,
notes
:
[
UNRESOLVED_NOTE
]
},
{
individual_note
:
false
,
resolvable
:
false
,
notes
:
[
UNRESOLVED_NOTE
]
},
],
unresolvedDiscussionsCount
:
0
,
};
mutations
.
UPDATE_RESOLVABLE_DISCUSSIONS_COUNTS
(
state
);
expect
(
state
.
unresolvedDiscussionsCount
).
toBe
(
1
);
expect
(
state
).
toEqual
(
jasmine
.
objectContaining
({
resolvableDiscussionsCount
:
1
,
unresolvedDiscussionsCount
:
1
,
hasUnresolvedDiscussions
:
false
,
}),
);
});
it
(
'
updates hasUnresolvedDiscussions
'
,
()
=>
{
it
(
'
with resolvable discussions, updates state
'
,
()
=>
{
const
state
=
{
discussions
:
[
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[{
resolved
:
false
}]
},
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[{
resolved
:
false
}]
},
{
individual_note
:
false
,
resolvable
:
false
,
notes
:
[{
resolved
:
false
}]
},
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[
RESOLVED_NOTE
,
SYSTEM_NOTE
,
RESOLVED_NOTE
],
},
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[
RESOLVED_NOTE
,
SYSTEM_NOTE
,
WEIRD_NOTE
],
},
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[
SYSTEM_NOTE
,
RESOLVED_NOTE
,
WEIRD_NOTE
,
UNRESOLVED_NOTE
],
},
{
individual_note
:
false
,
resolvable
:
true
,
notes
:
[
UNRESOLVED_NOTE
],
},
],
hasUnresolvedDiscussions
:
0
,
};
mutations
.
UPDATE_RESOLVABLE_DISCUSSIONS_COUNTS
(
state
);
expect
(
state
.
hasUnresolvedDiscussions
).
toBe
(
true
);
expect
(
state
).
toEqual
(
jasmine
.
objectContaining
({
resolvableDiscussionsCount
:
4
,
unresolvedDiscussionsCount
:
2
,
hasUnresolvedDiscussions
:
true
,
}),
);
});
});
});
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