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
17441085
Commit
17441085
authored
Mar 19, 2021
by
seotts
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test of shoudShowMuteModal when isReply
parent
5d7d1cde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
test/unit/components/compose-comment.test.jsx
test/unit/components/compose-comment.test.jsx
+19
-1
No files found.
test/unit/components/compose-comment.test.jsx
View file @
17441085
...
...
@@ -458,7 +458,25 @@ describe('Compose Comment test', () => {
global
.
Date
.
now
=
realDateNow
;
});
test
(
'
getMuteModalStartStep: not a reply
'
,
()
=>
{
test
(
'
shouldShowMuteModal is true when the user is already muted if the comment is a reply
'
,
()
=>
{
const
realDateNow
=
Date
.
now
.
bind
(
global
.
Date
);
global
.
Date
.
now
=
()
=>
0
;
// Since Date.now mocked to 0 above, we just need a small number to make
// it look like it was created < 2 minutes ago.
const
offense
=
{
expiresAt
:
'
1000
'
,
createdAt
:
'
-60
'
// ~1 ago min given shouldShowMuteModal's conversions,
};
const
muteStatus
=
{
offenses
:
[
offense
]
};
const
justMuted
=
false
;
const
commentInstance
=
getComposeCommentWrapper
({
isReply
:
true
}).
instance
();
expect
(
commentInstance
.
shouldShowMuteModal
(
muteStatus
,
justMuted
)).
toBe
(
true
);
global
.
Date
.
now
=
realDateNow
;
});
test
(
'
getMuteModalStartStep: not a reply
'
,
()
=>
{
const
commentInstance
=
getComposeCommentWrapper
({}).
instance
();
expect
(
commentInstance
.
getMuteModalStartStep
()).
toBe
(
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