fix a couple cypress test issues (#1267)

Co-authored-by: burnettk <burnettk@users.noreply.github.com>
This commit is contained in:
Kevin Burnett 2024-03-24 05:02:15 +00:00 committed by GitHub
parent 086234c901
commit fed785b50c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -35,8 +35,6 @@ Cypress.Commands.add('getBySel', (selector, ...args) => {
Cypress.Commands.add('navigateToHome', () => { Cypress.Commands.add('navigateToHome', () => {
cy.getBySel('header-menu-expand-button').click(); cy.getBySel('header-menu-expand-button').click();
cy.getBySel('side-nav-items').contains('Home').click(); cy.getBySel('side-nav-items').contains('Home').click();
// ensure we close the nav
cy.getBySel('header-menu-expand-button').click();
}); });
Cypress.Commands.add('navigateToAdmin', () => { Cypress.Commands.add('navigateToAdmin', () => {
@ -93,7 +91,8 @@ Cypress.Commands.add('createGroup', (groupId, groupDisplayName) => {
Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => { Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => {
cy.contains(modelId).should('not.exist'); cy.contains(modelId).should('not.exist');
cy.contains('Add a process model').click(); const dasherizedGroupId = groupId.replace(/\//g, '-');
cy.getBySel(`add-process-model-for-group-${dasherizedGroupId}`).click();
cy.get('input[name=display_name]').type(modelDisplayName); cy.get('input[name=display_name]').type(modelDisplayName);
cy.get('input[name=display_name]').should('have.value', modelDisplayName); cy.get('input[name=display_name]').should('have.value', modelDisplayName);
cy.get('input[name=id]').should('have.value', modelId); cy.get('input[name=id]').should('have.value', modelId);

View File

@ -71,6 +71,7 @@ export default function ProcessGroupShow() {
const modifiedProcessGroupId = modifyProcessIdentifierForPathParam( const modifiedProcessGroupId = modifyProcessIdentifierForPathParam(
processGroup.id processGroup.id
); );
const dasherizedProcessGroupId = modifiedProcessGroupId.replace(/:/g, '-');
const showNoItemsDisplayText = const showNoItemsDisplayText =
(processGroup.process_groups || []).length < 1 && (processGroup.process_groups || []).length < 1 &&
(processGroup.process_models || []).length < 1; (processGroup.process_models || []).length < 1;
@ -129,7 +130,10 @@ export default function ProcessGroupShow() {
a={targetUris.processModelCreatePath} a={targetUris.processModelCreatePath}
ability={ability} ability={ability}
> >
<Button href={`/process-models/${modifiedProcessGroupId}/new`}> <Button
href={`/process-models/${modifiedProcessGroupId}/new`}
data-qa={`add-process-model-for-group-${dasherizedProcessGroupId}`}
>
Add a process model Add a process model
</Button> </Button>
</Can> </Can>