[Web IDE] End-to-end test for preventUnload
Context
gitlab-web-ide#90 (comment 1380871920)
I was just about to commit my changes via the Web IDE in Safari 16.4 on Gitlab.com, and hit ⌘W to close the "VS Code" tab, and ended up closing the browser tab, instead. With no warning that I could see, I lost all my work. I'd say this warning is fairly important. Plus, perhaps, saving in-progress work in localStorage or something?
Description
We recently had a regression involving the preventUnload handling in the new Web IDE (warning the user if they will lose changes). It's a huge frustration when users encounter data loss.
Can we create a simple end-to-end or feature spec that will cover this scenario?
Scenario
- User opens Web IDE
- User makes a change
- User closes tab
- Tab does not close and the "unsaved changes" warning window shows instead