Ghost/ghost/admin/tests/unit/routes
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
..
collection-test.js Added collections CRUD UI 2023-05-23 17:26:47 +07:00
collections-test.js Added collections CRUD UI 2023-05-23 17:26:47 +07:00
explore-test.js Added Ghost Explore in Ghost as iframe app behind feature flag (#15495) 2022-10-07 14:32:54 +01:00
lexical-editor.new-test.js Added full-page refresh when new post route is in a bad state 2024-09-23 22:38:34 +01:00