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
edfa86e0
Commit
edfa86e0
authored
Aug 13, 2019
by
picklesrus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename tests. Move submit button test out into separate test.
parent
a100438d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
test/unit/components/join-flow-step.test.jsx
test/unit/components/join-flow-step.test.jsx
+17
-17
No files found.
test/unit/components/join-flow-step.test.jsx
View file @
edfa86e0
...
...
@@ -4,7 +4,7 @@ import JoinFlowStep from '../../../src/components/join-flow/join-flow-step';
describe
(
'
JoinFlowStep
'
,
()
=>
{
test
(
'
test
components exist when props present
'
,
()
=>
{
test
(
'
components exist when props present
'
,
()
=>
{
const
props
=
{
children
:
null
,
className
:
'
join-flow-step-class
'
,
...
...
@@ -33,15 +33,27 @@ describe('JoinFlowStep', () => {
expect
(
component
.
find
(
'
div.join-flow-description
'
).
text
()).
toEqual
(
props
.
description
);
component
.
find
(
'
button[type="submit"]
'
).
simulate
(
'
submit
'
);
expect
(
props
.
onSubmit
).
toHaveBeenCalled
();
expect
(
component
.
find
(
'
NextStepButton
'
).
prop
(
'
waiting
'
)).
toEqual
(
true
);
expect
(
component
.
find
(
'
NextStepButton
'
).
prop
(
'
content
'
)).
toEqual
(
props
.
nextButton
);
component
.
unmount
();
});
test
(
'
components do not exist when props not present
'
,
()
=>
{
const
component
=
mountWithIntl
(
<
JoinFlowStep
/>
);
expect
(
component
.
find
(
'
div.join-flow-header-image
'
).
exists
()).
toEqual
(
false
);
expect
(
component
.
find
(
'
.join-flow-inner-content
'
).
exists
()).
toEqual
(
true
);
expect
(
component
.
find
(
'
.join-flow-title
'
).
exists
()).
toEqual
(
false
);
expect
(
component
.
find
(
'
div.join-flow-description
'
).
exists
()).
toEqual
(
false
);
expect
(
component
.
find
(
'
NextStepButton
'
).
prop
(
'
waiting
'
)).
toEqual
(
false
);
component
.
unmount
();
});
test
(
'
test components do not exist when props not present
'
,
()
=>
{
test
(
'
clicking submit calls passed in function
'
,
()
=>
{
const
props
=
{
onSubmit
:
jest
.
fn
()
};
...
...
@@ -50,20 +62,8 @@ describe('JoinFlowStep', () => {
{
...
props
}
/>
);
expect
(
component
.
find
(
'
div.join-flow-header-image
'
).
exists
()).
toEqual
(
false
);
expect
(
component
.
find
(
'
.join-flow-inner-content
'
).
exists
()).
toEqual
(
true
);
expect
(
component
.
find
(
'
.join-flow-title
'
).
exists
()).
toEqual
(
false
);
expect
(
component
.
find
(
'
div.join-flow-description
'
).
exists
()).
toEqual
(
false
);
component
.
find
(
'
button[type="submit"]
'
).
simulate
(
'
submit
'
);
expect
(
props
.
onSubmit
).
toHaveBeenCalled
();
expect
(
component
.
find
(
'
NextStepButton
'
).
prop
(
'
waiting
'
)).
toEqual
(
false
);
component
.
unmount
();
});
});
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