Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
de5a8026
Commit
de5a8026
authored
Feb 05, 2021
by
picklesrus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the blue box on replies that got the user muted.
parent
9a3fe8f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
src/views/preview/comment/compose-comment.jsx
src/views/preview/comment/compose-comment.jsx
+1
-1
test/unit/components/compose-comment.test.jsx
test/unit/components/compose-comment.test.jsx
+21
-0
No files found.
src/views/preview/comment/compose-comment.jsx
View file @
de5a8026
...
@@ -240,7 +240,7 @@ class ComposeComment extends React.Component {
...
@@ -240,7 +240,7 @@ class ComposeComment extends React.Component {
render
()
{
render
()
{
return
(
return
(
<
React
.
Fragment
>
<
React
.
Fragment
>
{
(
this
.
isMuted
()
&&
!
this
.
props
.
isReply
)
?
(
{
(
this
.
isMuted
()
&&
!
(
this
.
props
.
isReply
&&
this
.
state
.
status
!==
ComposeStatus
.
REJECTED_MUTE
)
)
?
(
<
FlexRow
className=
"comment"
>
<
FlexRow
className=
"comment"
>
<
CommentingStatus
>
<
CommentingStatus
>
<
p
><
FormattedMessage
id=
{
this
.
getMuteMessageInfo
().
commentType
}
/></
p
>
<
p
><
FormattedMessage
id=
{
this
.
getMuteMessageInfo
().
commentType
}
/></
p
>
...
...
test/unit/components/compose-comment.test.jsx
View file @
de5a8026
...
@@ -173,6 +173,27 @@ describe('Compose Comment test', () => {
...
@@ -173,6 +173,27 @@ describe('Compose Comment test', () => {
global
.
Date
.
now
=
realDateNow
;
global
.
Date
.
now
=
realDateNow
;
});
});
test
(
'
Comment Status shows when user just submitted a reply comment that got them muted
'
,
()
=>
{
const
realDateNow
=
Date
.
now
.
bind
(
global
.
Date
);
global
.
Date
.
now
=
()
=>
0
;
const
component
=
getComposeCommentWrapper
({
isReply
:
true
});
const
commentInstance
=
component
.
instance
();
commentInstance
.
setState
({
status
:
'
REJECTED_MUTE
'
,
muteExpiresAtMs
:
100
});
component
.
update
();
expect
(
component
.
find
(
'
FlexRow.compose-comment
'
).
exists
()).
toEqual
(
true
);
expect
(
component
.
find
(
'
MuteModal
'
).
exists
()).
toEqual
(
false
);
expect
(
component
.
find
(
'
CommentingStatus
'
).
exists
()).
toEqual
(
true
);
// Compose box exists but is disabled
expect
(
component
.
find
(
'
InplaceInput.compose-input
'
).
exists
()).
toEqual
(
true
);
expect
(
component
.
find
(
'
InplaceInput.compose-input
'
).
props
().
disabled
).
toBe
(
true
);
expect
(
component
.
find
(
'
Button.compose-post
'
).
props
().
disabled
).
toBe
(
true
);
expect
(
component
.
find
(
'
Button.compose-cancel
'
).
props
().
disabled
).
toBe
(
true
);
global
.
Date
.
now
=
realDateNow
;
});
test
(
'
Comment Status shows when user just submitted a comment that got them muted
'
,
()
=>
{
test
(
'
Comment Status shows when user just submitted a comment that got them muted
'
,
()
=>
{
const
realDateNow
=
Date
.
now
.
bind
(
global
.
Date
);
const
realDateNow
=
Date
.
now
.
bind
(
global
.
Date
);
global
.
Date
.
now
=
()
=>
0
;
global
.
Date
.
now
=
()
=>
0
;
...
...
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