diff --git a/packages/web/src/components/TestSubstep/index.tsx b/packages/web/src/components/TestSubstep/index.tsx index 6eb22e7b..740ad7ea 100644 --- a/packages/web/src/components/TestSubstep/index.tsx +++ b/packages/web/src/components/TestSubstep/index.tsx @@ -39,6 +39,9 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement { const [executeFlow, { data, error, loading, called, reset }] = useMutation(EXECUTE_FLOW, { context: { autoSnackbar: false }}); const response = data?.executeFlow?.data; + const isCompleted = !error && called && !loading; + const hasNoOutput = !response && isCompleted; + const { name, } = substep; @@ -73,7 +76,7 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement { {error?.graphQLErrors.map((error) => (<>{error.message}
))} } - {called && !loading && !error && !response && ( + {hasNoOutput && ( {formatMessage('flowEditor.noTestDataTitle')} @@ -96,7 +99,8 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement { disabled={editorContext.readOnly} color="primary" > - Test & Continue + {isCompleted && formatMessage('flowEditor.continue')} + {!isCompleted && formatMessage('flowEditor.testAndContinue')} diff --git a/packages/web/src/locales/en.json b/packages/web/src/locales/en.json index e4b7454d..b3c1e9a3 100644 --- a/packages/web/src/locales/en.json +++ b/packages/web/src/locales/en.json @@ -49,6 +49,8 @@ "flowEditor.publishedFlowCannotBeUpdated": "To edit this flow, you must first unpublish it.", "flowEditor.noTestDataTitle": "We couldn't find matching data", "flowEditor.noTestDataMessage": "Create a sample in the associated service and test the step again.", + "flowEditor.testAndContinue": "Test & Continue", + "flowEditor.continue": "Continue", "flow.createdAt": "created {datetime}", "flow.updatedAt": "updated {datetime}", "flow.view": "View",