-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(editor): Add back prompt requesting to save unsaved changes (no-c…
…hangelog) (#10190)
- Loading branch information
1 parent
bfc8e1b
commit fa7bc45
Showing
9 changed files
with
156 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function getSaveChangesModal() { | ||
return cy.get('.el-overlay').contains('Save changes before leaving?'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { WorkflowsPage as WorkflowsPageClass } from '../pages/workflows'; | ||
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow'; | ||
import { EDIT_FIELDS_SET_NODE_NAME } from '../constants'; | ||
import { getSaveChangesModal } from '../composables/modals/save-changes-modal'; | ||
|
||
const WorkflowsPage = new WorkflowsPageClass(); | ||
const WorkflowPage = new WorkflowPageClass(); | ||
|
||
describe('Workflows', () => { | ||
beforeEach(() => { | ||
cy.visit(WorkflowsPage.url); | ||
}); | ||
|
||
it('should ask to save unsaved changes before leaving route', () => { | ||
WorkflowsPage.getters.newWorkflowButtonCard().should('be.visible'); | ||
WorkflowsPage.getters.newWorkflowButtonCard().click(); | ||
|
||
cy.createFixtureWorkflow('Test_workflow_1.json', 'Empty State Card Workflow'); | ||
|
||
WorkflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME); | ||
|
||
cy.getByTestId('project-home-menu-item').click(); | ||
|
||
getSaveChangesModal().should('be.visible'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.