From 4040614b22a6184e3cd93f75684bcd6936ff1bdd Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 19 Apr 2023 18:46:08 -0400 Subject: [PATCH] * add a user section to the acceptance tests, this is all that is required to allow the cypress tests to run against the built-in open-id. * If the interstitial page does not receive any tasks, it should redirect the main home page. I think this allows all the cypress tests to pass - as the most common moment for this to occur is when an end event has no documentation on it. --- .../config/permissions/acceptance_tests.yml | 7 +++++++ spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/acceptance_tests.yml b/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/acceptance_tests.yml index 29d3c9c0..0382f389 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/acceptance_tests.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/permissions/acceptance_tests.yml @@ -1,3 +1,10 @@ +users: + ciadmin1: + service: local_open_id + email: ciadmin1@spiffworkflow.org + password: ciadmin1 + preferred_username: ciadmin1 + groups: admin: users: [ciadmin1@spiffworkflow.org] diff --git a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx index 7c400d41..85d1f54e 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx @@ -53,6 +53,7 @@ export default function ProcessInterstitial() { return () => clearInterval(timerId); } return undefined; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [lastTask]); const processStatusImage = () => { @@ -94,6 +95,11 @@ export default function ProcessInterstitial() { ); }; + /** In the event there is no task information and the connection closed, + * redirect to the home page. */ + if (status === 'closed' && lastTask === null) { + navigate(`/tasks`); + } if (lastTask) { return ( <>