Commit 26eb6b0d authored by Jaden DIEFENBAUGH's avatar Jaden DIEFENBAUGH

[js][alg] add a bit of updateFunc counting in alg test

parent f7c83505
......@@ -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 });
......
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