Ghost/ghost/admin/tests
Kevin Ansfield 459a2c553e Added full-page refresh when new post route is in a bad state
ref https://linear.app/tryghost/issue/ONC-323

When the store gets into a bad state for new posts that causes saves to fail we can detect that by looking at the `model.isNew` property. Currently our best approach to fix this state is to restart the app.

- added a `didTransition()` hook to our `lexical-edit.new` route
  - detects the bad state, logs the error, and triggers a browser refresh
  - logs with a `recreatedPostIsGood` property that will let us know if we could instead just try recreating the post and avoiding a full refresh (so far we have no reproduction case so we need to learn what we can)
- added `sinon-chai` dependency for better assertions on spies/stubs
- added `sentry-testkit` dependency so we can test our Sentry integration calls
  - we can't use sinon for these calls because of the way Sentry's es6 imports work
- extracted our full Sentry config object generation to a util function so it can be re-used in unit tests
  - updated our integrations list to disable the default `dedupe` integration because it can cause very unexpected/difficult to debug test failures when you're asserting using `sentry-testkit`
2024-09-23 22:38:34 +01:00
..
acceptance Fixed "Editor crashed" error showing for a valid 404 2024-09-20 09:40:44 +01:00
helpers Fixed errors from 404 error handler for non-transition 404s 2024-09-13 11:02:55 +01:00
integration Added local revisions to the editor as backstop against data loss (#21044) 2024-09-20 00:08:28 -07:00
unit Added full-page refresh when new post route is in a bad state 2024-09-23 22:38:34 +01:00
index.html Remove ember application template wrapper 2018-05-01 10:57:20 +01:00
test-helper.js Added full-page refresh when new post route is in a bad state 2024-09-23 22:38:34 +01:00