Commit f627c099 authored by Jaden's avatar Jaden

new algorithms are created with an input & output

fixes #145
parent fbe7bd60
......@@ -122,21 +122,16 @@ describe('<AlgorithmEditor />', () => {
expect(wrapper.props().data.contents.groups[0]).to.have.property('name', 'group');
wrapper.find('button#newInputBtn').simulate('click');
expect(updateFunc.callCount).to.equal(2);
wrapper.find('button#newOutputBtn').simulate('click');
expect(updateFunc.callCount).to.equal(3);
wrapper.find('.algInput').find('CacheInput').prop('onChange')( { target: { value: 'in_data' }});
expect(updateFunc.callCount).to.equal(4);
expect(updateFunc.callCount).to.equal(2);
wrapper.find('.algOutput').find('CacheInput').prop('onChange')( { target: { value: 'out_data' }});
expect(updateFunc.callCount).to.equal(5);
expect(updateFunc.callCount).to.equal(3);
const ioType = 'system/integer/1';
wrapper.find('.algInput select').prop('onChange')( { target: { value: ioType }});
expect(updateFunc.callCount).to.equal(6);
expect(updateFunc.callCount).to.equal(4);
wrapper.find('.algOutput select').prop('onChange')( { target: { value: ioType }});
expect(updateFunc.callCount).to.equal(7);
expect(updateFunc.callCount).to.equal(5);
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 });
......@@ -198,9 +193,6 @@ describe('<AlgorithmEditor />', () => {
expect(wrapper.props().data.contents.groups[0]).to.have.property('name', 'group');
wrapper.find('button#newInputBtn').simulate('click');
wrapper.find('button#newOutputBtn').simulate('click');
wrapper.find('.algInput').find('CacheInput').prop('onChange')( { target: { value: 'in_data' }});
wrapper.find('.algOutput').find('CacheInput').prop('onChange')( { target: { value: 'out_data' }});
......@@ -311,8 +303,6 @@ describe('<AlgorithmEditor />', () => {
expect(wrapper.props().data.contents.groups[0]).to.have.property('name', 'group');
wrapper.find('button#newInputBtn').simulate('click');
wrapper.find('.algInput').find('CacheInput').prop('onChange')( { target: { value: 'in_data' }});
const ioType = 'system/integer/1';
......@@ -438,9 +428,6 @@ describe('<AlgorithmEditor />', () => {
// Group 1
expect(wrapper.props().data.contents.groups[0]).to.have.property('name', 'group');
wrapper.find('#endpoint0 button#newInputBtn').simulate('click');
wrapper.find('#endpoint0 button#newOutputBtn').simulate('click');
wrapper.find('#endpoint0 .algInput').find('CacheInput').prop('onChange')( { target: { value: 'in_data' }});
wrapper.find('#endpoint0 .algOutput').find('CacheInput').prop('onChange')( { target: { value: 'out_data' }});
......@@ -525,9 +512,6 @@ describe('<AlgorithmEditor />', () => {
expect(wrapper.props().data.contents.groups[0]).to.have.property('name', 'group');
wrapper.find('button#newInputBtn').simulate('click');
wrapper.find('button#newOutputBtn').simulate('click');
wrapper.find('.algInput').find('CacheInput').prop('onChange')( { target: { value: 'in_data' }});
wrapper.find('.algOutput').find('CacheInput').prop('onChange')( { target: { value: 'out_data' }});
......@@ -622,8 +606,6 @@ describe('<AlgorithmEditor />', () => {
expect(wrapper.props().data.contents.groups[0]).to.have.property('name', 'group');
wrapper.find('button#newInputBtn').simulate('click');
wrapper.find('.algInput').find('CacheInput').prop('onChange')( { target: { value: 'in_data' }});
const ioType = 'system/integer/1';
......
......@@ -272,8 +272,8 @@ export const getValidAlgorithmObj = (data: BeatObject = {name: '', contents: {}}
groups: [
{
name: 'group',
inputs: {},
outputs: {},
inputs: {'input': { type: '' }},
outputs: {'output': { type: '' }},
}
],
description: '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment