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
4a522606
Commit
4a522606
authored
Feb 11, 2021
by
seotts
Committed by
Chris Garrity
Feb 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and add tests for feedback link
parent
7bd6c98b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
test/unit/components/mute-modal.test.jsx
test/unit/components/mute-modal.test.jsx
+25
-3
No files found.
test/unit/components/mute-modal.test.jsx
View file @
4a522606
...
@@ -117,9 +117,12 @@ describe('MuteModalTest', () => {
...
@@ -117,9 +117,12 @@ describe('MuteModalTest', () => {
expect
(
component
.
instance
().
state
.
step
).
toBe
(
0
);
expect
(
component
.
instance
().
state
.
step
).
toBe
(
0
);
});
});
test
(
'
Mute modal asks for feedback
'
,
()
=>
{
test
(
'
Mute modal asks for feedback
if showFeedback
'
,
()
=>
{
const
component
=
mountWithIntl
(
const
component
=
mountWithIntl
(
<
MuteModal
muteModalMessages=
{
defaultMessages
}
/>
<
MuteModal
showFeedback
muteModalMessages=
{
defaultMessages
}
/>
);
);
component
.
find
(
'
MuteModal
'
).
instance
()
component
.
find
(
'
MuteModal
'
).
instance
()
.
setState
({
step
:
1
});
.
setState
({
step
:
1
});
...
@@ -127,9 +130,22 @@ describe('MuteModalTest', () => {
...
@@ -127,9 +130,22 @@ describe('MuteModalTest', () => {
expect
(
component
.
find
(
'
p.feedback-prompt
'
).
exists
()).
toEqual
(
true
);
expect
(
component
.
find
(
'
p.feedback-prompt
'
).
exists
()).
toEqual
(
true
);
});
});
test
(
'
Mute modal asks for feedback on extra showWarning step
'
,
()
=>
{
test
(
'
Mute modal do not ask for feedback if not showFeedback
'
,
()
=>
{
const
component
=
mountWithIntl
(
<
MuteModal
muteModalMessages=
{
defaultMessages
}
/>
);
component
.
find
(
'
MuteModal
'
).
instance
()
.
setState
({
step
:
1
});
component
.
update
();
expect
(
component
.
find
(
'
p.feedback-prompt
'
).
exists
()).
toEqual
(
false
);
});
test
(
'
Mute modal asks for feedback on extra showWarning step if showFeedback
'
,
()
=>
{
const
component
=
mountWithIntl
(
const
component
=
mountWithIntl
(
<
MuteModal
<
MuteModal
showFeedback
showWarning
showWarning
muteModalMessages=
{
defaultMessages
}
muteModalMessages=
{
defaultMessages
}
/>
/>
...
@@ -158,6 +174,12 @@ describe('MuteModalTest', () => {
...
@@ -158,6 +174,12 @@ describe('MuteModalTest', () => {
const
component
=
shallowWithIntl
(
const
component
=
shallowWithIntl
(
<
MuteModal
<
MuteModal
muteModalMessages=
{
defaultMessages
}
muteModalMessages=
{
defaultMessages
}
user=
{
{
id
:
12345
,
username
:
'
myusername
'
,
token
:
'
mytoken
'
,
thumbnailUrl
:
'
mythumbnail
'
}
}
/>
/>
).
dive
();
).
dive
();
component
.
instance
().
handleFeedbackSubmit
(
'
something
'
);
component
.
instance
().
handleFeedbackSubmit
(
'
something
'
);
...
...
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