Skip to content

Commit

Permalink
fix(web): show add step side menu after delete of step
Browse files Browse the repository at this point in the history
  • Loading branch information
ainouzgali committed Jun 14, 2023
1 parent 4f96f94 commit 05bf11d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions apps/web/cypress/tests/notification-editor/steps-actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@ describe('Workflow Editor - Steps Actions', function () {
cy.getByTestId('drag-side-menu').contains('Channels');
});

it('should show add step in sidebar after a delete of a step with side settings ', function () {
interceptEditTemplateRequests();
const template = this.session.templates[0];

cy.visit('/workflows/edit/' + template._id);
waitForEditTemplateRequests();
dragAndDrop('digest');
cy.get('.react-flow__node').should('have.length', 5);
cy.clickWorkflowNode('node-digestSelector');

cy.getByTestId('node-digestSelector')
.getByTestId('channel-node')
.last()
.trigger('mouseover', { force: true })
.getByTestId('delete-step-action')
.click();
cy.get('.mantine-Modal-modal button').contains('Delete step').click();
cy.getByTestId(`node-digestSelector`).should('not.exist');
cy.get('.react-flow__node').should('have.length', 4);
cy.getByTestId('drag-side-menu').contains('Channels');
});

it('should keep steps order on reload', function () {
interceptEditTemplateRequests();
const template = this.session.templates[0];
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/pages/templates/workflow/WorkflowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const WorkflowEditor = () => {
const index = steps.findIndex((item) => item.uuid === toDelete);
deleteStep(index);
setToDelete('');
navigate(basePath);
};

const cancelDelete = () => {
Expand Down

0 comments on commit 05bf11d

Please sign in to comment.