Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
ebce0652
Commit
ebce0652
authored
Sep 21, 2018
by
Jaden DIEFENBAUGH
Committed by
Flavio Tarsetti
Oct 05, 2018
Browse files
[js][tc] fix
#144
& add tests
parent
c119a6c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
conda/js/src/components/toolchain/ToolchainConnection.jsx
View file @
ebce0652
...
...
@@ -84,7 +84,7 @@ class ToolchainConnection extends React.Component<Props> {
render
=
()
=>
{
const
conn
=
this
.
props
.
connection
;
const
connectionId
=
`
#
${
connectionToId
(
conn
)
}
`
;
const
connectionId
=
`
${
connectionToId
(
conn
)
}
`
;
const
fromLoc
=
this
.
props
.
fromLocMap
;
const
toLoc
=
this
.
props
.
toLocMap
;
//console.log(`connecting "${ connId }" from ${ fromInfo } to ${ toInfo }`);
...
...
conda/js/src/components/toolchain/ToolchainEditor.spec.jsx
View file @
ebce0652
...
...
@@ -986,5 +986,33 @@ describe('<ToolchainEditor />', function() {
expect
(
data
.
contents
.
representation
.
connections
).
to
.
have
.
property
(
'
training_alg.lda/testing_alg.lda_machine
'
);
expect
(
data
.
contents
.
representation
.
connections
).
to
.
not
.
have
.
property
(
'
training_alg.lda_machine/testing_alg.lda_machine
'
);
});
it
(
'
Properly deletes the training_data.species/training_alg.species connection
'
,
async
()
=>
{
const
conToDel
=
{
from
:
'
training_data.species
'
,
to
:
'
training_alg.species
'
,
channel
:
'
training_data
'
};
const
tc
=
getValidObj
(
getIrisTc
());
wrapper
=
mount
(
<
C
data
=
{
tc
}
sets
=
{
sets
}
protocols
=
{
protocols
}
toolchains
=
{
state
.
toolchain
}
databases
=
{
state
.
database
}
normalAlgorithms
=
{
normalAlgorithms
}
analyzerAlgorithms
=
{
analyzerAlgorithms
}
saveFunc
=
{
saveFunc
}
updateFunc
=
{
updateFunc
}
/>
);
// change testing_alg.lda_machine to testing_alg.lda
expect
(
wrapper
.
exists
(
'
#training_data-species-training_alg-species
'
)).
to
.
equal
(
true
);
wrapper
.
instance
().
handleConnectionContextMenu
({},
{
clicked
:
'
delete
'
,
connection
:
conToDel
});
wrapper
.
update
();
expect
(
wrapper
.
exists
(
'
#training_data-species-training_alg-species
'
)).
to
.
equal
(
false
);
const
data
=
wrapper
.
props
().
data
;
expect
(
data
.
contents
.
representation
.
connections
).
to
.
not
.
have
.
property
(
'
training_data.species/training_data.species
'
);
expect
(
data
.
contents
.
connections
.
findIndex
(
c
=>
c
.
from
==
conToDel
.
from
&&
c
.
to
==
conToDel
.
to
)).
to
.
equal
(
-
1
);
});
});
});
conda/js/src/components/toolchain/ToolchainModal.spec.jsx
View file @
ebce0652
...
...
@@ -12,7 +12,7 @@ const sleep = (ms) => {
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
};
describe
.
only
(
'
<ToolchainModal />
'
,
()
=>
{
describe
(
'
<ToolchainModal />
'
,
()
=>
{
let
wrapper
;
afterEach
(()
=>
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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