From f89b8bdda2896025351fb9774d7d9fe7aa046f07 Mon Sep 17 00:00:00 2001 From: burnettk Date: Fri, 11 Nov 2022 22:12:35 -0500 Subject: [PATCH] fix a couple tests --- .../cypress/e2e/process_models.cy.js | 5 ++- .../src/components/ButtonWithConfirmation.tsx | 3 ++ .../src/routes/ProcessGroupShow.tsx | 41 +++++++++++-------- .../src/routes/ProcessInstanceShow.tsx | 1 + 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/spiffworkflow-frontend/cypress/e2e/process_models.cy.js b/spiffworkflow-frontend/cypress/e2e/process_models.cy.js index cc4ef606f..705f6011c 100644 --- a/spiffworkflow-frontend/cypress/e2e/process_models.cy.js +++ b/spiffworkflow-frontend/cypress/e2e/process_models.cy.js @@ -144,10 +144,11 @@ describe('process-models', () => { cy.getBySel('process-instance-list-link').click(); cy.getBySel('process-instance-show-link').click(); - cy.contains('Delete').click(); + cy.getBySel('process-instance-delete').click(); cy.contains('Are you sure'); cy.getBySel('modal-confirmation-dialog').find('.cds--btn--danger').click(); - cy.contains(`Process Instances for: ${groupId}/${modelId}`); + + // in breadcrumb cy.contains(modelId).click(); cy.contains('Edit process model').click(); diff --git a/spiffworkflow-frontend/src/components/ButtonWithConfirmation.tsx b/spiffworkflow-frontend/src/components/ButtonWithConfirmation.tsx index 883869199..a58dbe1ca 100644 --- a/spiffworkflow-frontend/src/components/ButtonWithConfirmation.tsx +++ b/spiffworkflow-frontend/src/components/ButtonWithConfirmation.tsx @@ -3,6 +3,7 @@ import { useState } from 'react'; import { Button, Modal } from '@carbon/react'; type OwnProps = { + 'data-qa'?: string; description?: string; buttonLabel?: string; onConfirmation: (..._args: any[]) => any; @@ -18,6 +19,7 @@ export default function ButtonWithConfirmation({ description, buttonLabel, onConfirmation, + 'data-qa': dataQa, title = 'Are you sure?', confirmButtonLabel = 'OK', kind = 'danger', @@ -58,6 +60,7 @@ export default function ButtonWithConfirmation({ return ( <>