Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for beforeunload #62

Open
alexhad6 opened this issue Jun 1, 2023 · 0 comments
Open

Tests for beforeunload #62

alexhad6 opened this issue Jun 1, 2023 · 0 comments

Comments

@alexhad6
Copy link
Contributor

alexhad6 commented Jun 1, 2023

Could try adding end-to-end tests for beforeunload prompting when the user has unsaved changes.

Was able to add tests for confirm prompt in parameter-editing.cy.ts, but beforeunload is trickier. Cypress can bind to the event (https://docs.cypress.io/api/cypress-api/catalog-of-events), but this event is called every time the page reloads. Also, testing beforeunload can be tricky because it can actually prevent the page from reloading (see https://glebbahmutov.com/blog/onbeforeunload/).

@alexhad6 alexhad6 changed the title Tests for beforeunload and confirm (?) Tests for beforeunload Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant