3cfdcfb15f
ref https://linear.app/tryghost/issue/ONC-160 - POST is incorrect as the form itself doesn't post to any path; all we want are the authentication flows to kick off on submit We've had reports of users experiencing a 404 error on attempting to sign in to Ghost Admin (at /ghost/), where the login form seems to submit a POST request to the /ghost/ path (we don't have a route for that method, hence the 404; only GET). While I haven't been able to reproduce the issue, there's very few places in Ghost that actually issue a POST request. Removing this method here has no impact to Ghost auth and may prevent some unexpected default behavior from the browser. |
||
---|---|---|
.. | ||
app | ||
config | ||
lib | ||
mirage | ||
public/assets | ||
tests | ||
.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 | ||
README.md | ||
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.
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.