Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
26eb6b0d
Commit
26eb6b0d
authored
Jul 18, 2018
by
Jaden DIEFENBAUGH
Browse files
[js][alg] add a bit of updateFunc counting in alg test
parent
f7c83505
Changes
1
Hide whitespace changes
Inline
Side-by-side
conda/js/src/components/algorithm/AlgorithmEditor.spec.jsx
View file @
26eb6b0d
...
...
@@ -112,25 +112,34 @@ describe('<AlgorithmEditor />', () => {
expect
(
wrapper
.
props
().
data
).
to
.
have
.
property
(
'
name
'
,
algName
);
wrapper
.
find
(
'
#algSplittable input
'
).
prop
(
'
onChange
'
)(
{
target
:
{
checked
:
true
}});
expect
(
updateFunc
.
callCount
).
to
.
equal
(
1
);
expect
(
wrapper
.
props
().
data
.
contents
).
to
.
have
.
property
(
'
splittable
'
,
true
);
wrapper
.
find
(
'
button#newGroupBtn
'
).
simulate
(
'
click
'
);
expect
(
updateFunc
.
callCount
).
to
.
equal
(
2
);
expect
(
wrapper
.
props
().
data
.
contents
).
to
.
have
.
property
(
'
groups
'
).
with
.
lengthOf
(
1
);
expect
(
wrapper
.
props
().
data
.
contents
.
groups
[
0
]).
to
.
have
.
property
(
'
inputs
'
);
expect
(
wrapper
.
props
().
data
.
contents
.
groups
[
0
]).
to
.
have
.
property
(
'
outputs
'
);
wrapper
.
find
(
'
CacheInput[placeholder="Group Name..."]
'
).
prop
(
'
onChange
'
)(
{
target
:
{
value
:
'
main
'
}});
expect
(
updateFunc
.
callCount
).
to
.
equal
(
3
);
expect
(
wrapper
.
props
().
data
.
contents
.
groups
[
0
]).
to
.
have
.
property
(
'
name
'
,
'
main
'
);
wrapper
.
find
(
'
button#newInputBtn
'
).
simulate
(
'
click
'
);
expect
(
updateFunc
.
callCount
).
to
.
equal
(
4
);
wrapper
.
find
(
'
button#newOutputBtn
'
).
simulate
(
'
click
'
);
expect
(
updateFunc
.
callCount
).
to
.
equal
(
5
);
wrapper
.
find
(
'
.algInput
'
).
find
(
'
CacheInput
'
).
prop
(
'
onChange
'
)(
{
target
:
{
value
:
'
in_data
'
}});
expect
(
updateFunc
.
callCount
).
to
.
equal
(
6
);
wrapper
.
find
(
'
.algOutput
'
).
find
(
'
CacheInput
'
).
prop
(
'
onChange
'
)(
{
target
:
{
value
:
'
out_data
'
}});
expect
(
updateFunc
.
callCount
).
to
.
equal
(
7
);
const
ioType
=
'
system/integer/1
'
;
wrapper
.
find
(
'
.algInput select
'
).
prop
(
'
onChange
'
)(
{
target
:
{
value
:
ioType
}});
expect
(
updateFunc
.
callCount
).
to
.
equal
(
8
);
wrapper
.
find
(
'
.algOutput select
'
).
prop
(
'
onChange
'
)(
{
target
:
{
value
:
ioType
}});
expect
(
updateFunc
.
callCount
).
to
.
equal
(
9
);
expect
(
wrapper
.
props
().
data
.
contents
.
groups
[
0
].
inputs
).
to
.
have
.
deep
.
property
(
'
in_data
'
,
{
type
:
ioType
});
expect
(
wrapper
.
props
().
data
.
contents
.
groups
[
0
].
outputs
).
to
.
have
.
deep
.
property
(
'
out_data
'
,
{
type
:
ioType
});
...
...
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