@@ -31,7 +31,8 @@ var inputId4 = 'input-with-geodata-2';
3131var inputId5 = 'input-with-geodata-3' ;
3232var testModelId ;
3333var testModelVersionId ;
34- var testWorkflowId = process . env . WORKFLOW_ID || 'some_workflow' ;
34+ var testWorkflowId ;
35+ var generalModelVersionId = 'aa9ca48295b37401f8af92ad1af0d91d' ;
3536
3637describe ( 'Clarifai JS SDK' , function ( ) {
3738 beforeAll ( function ( ) {
@@ -1406,22 +1407,28 @@ describe('Clarifai JS SDK', function() {
14061407
14071408 describe ( 'Workflow' , ( ) => {
14081409 it ( 'Call given workflow id with one input' , done => {
1409- app . workflow . predict ( testWorkflowId , sampleImage1 )
1410- . then ( response => {
1411- expect ( response . workflow ) . toBeDefined ( ) ;
1412- const result = response . results [ 0 ] ;
1413- const input = result . input ;
1414- expect ( input . id ) . toBeDefined ( ) ;
1415- expect ( input . data ) . toBeDefined ( ) ;
1416- const outputs = result . outputs ;
1417- const output = outputs [ 0 ] ;
1418- expect ( output . id ) . toBeDefined ( ) ;
1419- expect ( output . status ) . toBeDefined ( ) ;
1420- expect ( output . created_at ) . toBeDefined ( ) ;
1421- expect ( output . model ) . toBeDefined ( ) ;
1422- expect ( output . model . model_version ) . toBeDefined ( ) ;
1423- done ( ) ;
1424- } ) . catch ( errorHandler . bind ( done ) ) ;
1410+ testWorkflowId = 'big-bang' + Date . now ( ) ;
1411+ app . workflow . create ( testWorkflowId , {
1412+ modelId : Clarifai . GENERAL_MODEL ,
1413+ modelVersionId : generalModelVersionId
1414+ } ) . then ( workflowId => {
1415+ app . workflow . predict ( workflowId , sampleImage1 )
1416+ . then ( response => {
1417+ expect ( response . workflow ) . toBeDefined ( ) ;
1418+ const result = response . results [ 0 ] ;
1419+ const input = result . input ;
1420+ expect ( input . id ) . toBeDefined ( ) ;
1421+ expect ( input . data ) . toBeDefined ( ) ;
1422+ const outputs = result . outputs ;
1423+ const output = outputs [ 0 ] ;
1424+ expect ( output . id ) . toBeDefined ( ) ;
1425+ expect ( output . status ) . toBeDefined ( ) ;
1426+ expect ( output . created_at ) . toBeDefined ( ) ;
1427+ expect ( output . model ) . toBeDefined ( ) ;
1428+ expect ( output . model . model_version ) . toBeDefined ( ) ;
1429+ done ( ) ;
1430+ } ) . catch ( errorHandler . bind ( done ) ) ;
1431+ } ) ;
14251432 } ) ;
14261433
14271434 it ( 'Call given workflow id with multiple inputs with specified types' , done => {
0 commit comments