From a2130ec1d2db13774772601ad2113e0aa0c37d69 Mon Sep 17 00:00:00 2001 From: jasquat Date: Fri, 14 Apr 2023 10:00:06 -0400 Subject: [PATCH] fix cypress tests --- spiffworkflow-frontend/cypress/e2e/tasks.cy.js | 4 +++- spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spiffworkflow-frontend/cypress/e2e/tasks.cy.js b/spiffworkflow-frontend/cypress/e2e/tasks.cy.js index a4b4a4ddc..50d24899f 100644 --- a/spiffworkflow-frontend/cypress/e2e/tasks.cy.js +++ b/spiffworkflow-frontend/cypress/e2e/tasks.cy.js @@ -90,7 +90,9 @@ describe('tasks', () => { cy.get('.is-visible .cds--modal-close').click(); cy.navigateToHome(); - cy.contains('Tasks').should('exist'); + + // look for somethig to make sure the homepage has loaded + cy.contains('Waiting for me').should('exist'); // FIXME: this will probably need a better way to link to the proper form that we want cy.contains('Go').click(); diff --git a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx index 82dddd4ad..9b9307f82 100644 --- a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx +++ b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx @@ -467,7 +467,9 @@ export default function ReactDiagramEditor({ return; } diagramModelerToUse.importXML(diagramXMLToDisplay).then(() => { - diagramModelerToUse.get('canvas').zoom('fit-viewport'); + if (diagramType === 'bpmn' || diagramType === 'readonly') { + diagramModelerToUse.get('canvas').zoom('fit-viewport'); + } }); alreadyImportedXmlRef.current = true;