make sure to pass the correct form of process group id when creating a process model w/ burnettk cullerton
This commit is contained in:
parent
ee39177b20
commit
53d8b3f140
|
@ -42,7 +42,7 @@ describe('process-models', () => {
|
|||
it.only('can create new bpmn, dmn, and json files', () => {
|
||||
const uuid = () => Cypress._.random(0, 1e6);
|
||||
const id = uuid();
|
||||
const groupId = 'acceptance-tests-group-one';
|
||||
const groupId = 'misc/acceptance-tests-group-one';
|
||||
const groupDisplayName = 'Acceptance Tests Group One';
|
||||
const modelDisplayName = `Test Model 2 ${id}`;
|
||||
const modelId = `test-model-2-${id}`;
|
||||
|
@ -51,6 +51,7 @@ describe('process-models', () => {
|
|||
const dmnFileName = `dmn_test_file_${id}`;
|
||||
const jsonFileName = `json_test_file_${id}`;
|
||||
|
||||
cy.contains('Misc').click();
|
||||
cy.contains(groupDisplayName).click();
|
||||
cy.createModel(groupId, modelId, modelDisplayName);
|
||||
cy.contains(groupId).click();
|
||||
|
|
|
@ -76,7 +76,10 @@ Cypress.Commands.add('createModel', (groupId, modelId, modelDisplayName) => {
|
|||
cy.get('input[name=id]').should('have.value', modelId);
|
||||
cy.contains('Submit').click();
|
||||
|
||||
cy.url().should('include', `process-models/${groupId}:${modelId}`);
|
||||
cy.url().should(
|
||||
'include',
|
||||
`process-models/${cy.modifyProcessModelPath(groupId)}:${modelId}`
|
||||
);
|
||||
cy.contains(`Process Model: ${modelDisplayName}`);
|
||||
});
|
||||
|
||||
|
|
|
@ -52,7 +52,9 @@ export default function ProcessModelForm({
|
|||
if (hasErrors) {
|
||||
return;
|
||||
}
|
||||
const path = `/process-models/${processGroupId}`;
|
||||
const path = `/process-models/${modifyProcessModelPath(
|
||||
processGroupId || ''
|
||||
)}`;
|
||||
let httpMethod = 'POST';
|
||||
if (mode === 'edit') {
|
||||
httpMethod = 'PUT';
|
||||
|
|
|
@ -3,6 +3,7 @@ import { useParams } from 'react-router-dom';
|
|||
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
||||
import { ProcessModel } from '../interfaces';
|
||||
import ProcessModelForm from '../components/ProcessModelForm';
|
||||
import { unModifyProcessModelPath } from '../helpers';
|
||||
|
||||
export default function ProcessModelNew() {
|
||||
const params = useParams();
|
||||
|
@ -28,7 +29,7 @@ export default function ProcessModelNew() {
|
|||
<h1>Add Process Model</h1>
|
||||
<ProcessModelForm
|
||||
mode="new"
|
||||
processGroupId={params.process_group_id}
|
||||
processGroupId={unModifyProcessModelPath(params.process_group_id || '')}
|
||||
processModel={processModel}
|
||||
setProcessModel={setProcessModel}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue