Ghost/ghost/admin
Ronald Langeveld c8ba9e8027
🐛 Fixed unsaved changes confirmation on Lexical schema change (#20687)
refs ENG-661

Fixes a long-standing issue where an outdated Lexical schema in the
database triggered the unsaved changes confirmation dialog incorrectly.
Implemented a secondary hidden Lexical instance that loads the state
from the database, renders it, and uses this updated state to compare
with the live editor's scratch.
This ensures the unsaved changes prompt appears only when there are real
changes from the user.
2024-08-05 12:58:58 +00:00
..
app 🐛 Fixed unsaved changes confirmation on Lexical schema change (#20687) 2024-08-05 12:58:58 +00:00
config Cleaned up websockets experiment (#20547) 2024-07-04 16:08:06 +00:00
lib Updated timezone dependency (#20570) 2024-07-09 16:31:36 -05:00
mirage Improved performance loading posts & pages in admin (#20646) 2024-07-29 16:19:28 +00:00
public/assets
tests 🐛 Fixed unsaved changes confirmation on Lexical schema change (#20687) 2024-08-05 12:58:58 +00:00
.editorconfig
.ember-cli
.eslintignore
.eslintrc.js
.lint-todo
.lint-todorc.js
.template-lintrc.js
.watchmanconfig
ember-cli-build.js
ember-cli-update.json
jsconfig.json
package.json v5.89.0 2024-08-02 15:05:06 +00:00
README.md Updated Ghost Admin README with updated test instructions (#20561) 2024-07-08 16:57:52 +00:00
testem.js

Ghost-Admin

This is the home of the Ember.js-based Admin app that ships with Ghost.

Test

Running tests in the browser

Run all tests in the browser by running yarn dev in the Ghost monorepo and visiting http://localhost:4200/tests. The code is hotloaded on change and you can filter which tests to run.

Testing public documentation


Tip: You can use await this.pauseTest() in your tests to temporarily pause the execution of browser tests. Use the browser console to inspect and debug the DOM, then resume tests by running resumeTest() directly in the browser console (docs)

Running tests in the CLI

To build and run tests in the CLI, you can use:

TZ=UTC yarn test

Note the TZ=UTC environment variable which is currently required to get tests working if your system timezone doesn't match UTC.


However, this is very slow when writing tests, as it requires the app to be rebuilt on every change. Instead, create a separate watching build with:

yarn build --environment=test -w -o="dist-test"

Then run tests with:

TZ=UTC yarn test 1 --reporter dot --path="dist-test"

The --reporter dot shows a dot (.) for every successful test, and F for every failed test. It renders the output of the failed tests only.


To run a specific test file:

TZ=UTC yarn test 1 --reporter dot --path="dist-test" -mp=tests/unit/helpers/gh-count-characters-test.js

To have a full list of the available options, run

ember exam --help

Copyright & License

Copyright (c) 2013-2024 Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.