2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Commit graph

3553 commits

Author SHA1 Message Date
Renovate Bot
d88770cc32 Update dependency @tryghost/tpl to v0.1.12 2022-02-22 12:19:20 +01:00
Renovate Bot
0e7eb4acd9 Update dependency @tryghost/version to v0.1.11 2022-02-22 12:17:30 +01:00
Kevin Ansfield
00195b5bc4 Merged v4.36.3 into main 2022-02-22 10:28:55 +00:00
Daniel Lockyer
8b8144a3b8 v4.36.3 2022-02-22 10:25:09 +00:00
Naz
fd0a3e80ae Removed @tryghost/jest-snapshot dependency
refs https://github.com/TryGhost/Toolbox/issues/215

- Ghost tests had difficulty running sometimes when the versions for jest-snapshot package did not match in Ghost and @tryghost/express-test
- This is the error that was showing up: `IncorrectUsageError: Unable to run snapshot tests, current test was not configured`
- The reason why snapshot tests were misconfigured was multiple instances of SnapshotManager, which broke the singleton pattern
- Having jest-snapshot embeded within express-test makes sure the versions stay the same across the clients
- The version bump also introduces passing "queryParams" parameter into the Agent constructor - enables configuring query parameters that would appear in each agent's request. Example usecase - Content API authentication parameter "key" would be nice to "remember" and add to every request URL
2022-02-22 09:41:58 +07:00
Renovate Bot
63762afc49
Update dependency express-jwt to v6.1.1 2022-02-21 17:23:30 +00:00
Renovate Bot
b19bb35aca Update dependency mocha to v9.2.1 2022-02-21 12:53:22 +00:00
Hannah Wolfe
5bf12939e4
Updated eslint-plugin-ghost & fixed resulting failures
- I recently added a bunch of strict rules to our eslint plugin around returns: ca9af37866
- These mostly are issues that occur whilst writing code, that you spot and fix as you're developing, but they're annoying to notice/find and eslint can be used to flag them quickly
- There are of course, edge cases where you don't need to return from array fns, but this rule also suggests better patterns might be available
- For our excert helper and new assertEvent helper, I've updated the code to use simpler patterns that are easier to read, so as to avoid the warnings
- For our old API I've simply disabled the rule as we're about to delete this code
2022-02-21 12:30:12 +00:00
Daniel Lockyer
0ccbfea8fc v4.36.2 2022-02-18 16:00:29 +00:00
Renovate Bot
34fbed10bd Update dependency @tryghost/validator to v0.1.13 2022-02-18 14:33:31 +01:00
Renovate Bot
72fe844396 Update dependency @tryghost/nodemailer to v0.3.12 2022-02-18 14:28:29 +01:00
Renovate Bot
0a84bae1b8 Update dependency @tryghost/errors to v1.2.2 2022-02-18 14:13:57 +01:00
Naz
32884fa412 🐛 Fixed StripeAPI disconnection
refs https://github.com/TryGhost/Toolbox/issues/214

- After calling `DELETE /settings/stripe/connect/` Admin API endpoint, stripe did not fully disconnect causing other Member API endpoints to behave as if Stripe was still configured
2022-02-18 16:30:50 +07:00
Renovate Bot
c8105ea08f Update dependency @tryghost/html-to-mobiledoc to v1.8.5 2022-02-18 09:23:55 +01:00
Renovate Bot
39ab0baa82 Update dependency @tryghost/magic-link to v1.0.19 2022-02-18 09:21:38 +01:00
Renovate Bot
15572127fa Update dependency @tryghost/request to v0.1.15 2022-02-18 09:15:04 +01:00
Renovate Bot
2e7885f3a9 Update dependency @tryghost/bookshelf-plugins to v0.3.9 2022-02-18 09:14:51 +01:00
renovate[bot]
b807f12c44
Update dependency @tryghost/members-importer to v0.5.2 (#14169)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-17 18:18:02 +02:00
renovate[bot]
6a5e7f6ccb
Update dependency @tryghost/members-ssr to v1.0.21 (#14170)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-17 15:38:08 +02:00
renovate[bot]
fc0d679fa2
Update dependency @tryghost/members-api to v5.0.2 (#14168)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-02-17 15:37:42 +02:00
Fabien 'egg' O'Carroll
daa39bf4fe
🐛 Fixed error handling webhooks for unknown member (#14155)
https://github.com/TryGhost/Team/issues/1374

When we receive a web hook to update payment details for a customer
which is not associated with a Member, instead of proceeding and erroring
we now return early and respond to Stripe with a 200. A test has been 
added to ensure this
2022-02-17 14:51:40 +02:00
Renovate Bot
d2081059de Update dependency @playwright/test to v1.19.1 2022-02-17 12:32:55 +01:00
Daniel Lockyer
1a0362f3db Added demo E2E browser test
refs https://github.com/TryGhost/Toolbox/issues/207

- we want to start writing some E2E tests that involve automated
  pointing and clicking around the frontend of Ghost to test that
  members of Ghost sites can still do what we expect
- we've decided to look in to Playwright for this - it looks __really__
  nice
- this is a VERY basic first test - it'll check for a 200 on the
  homepage of whatever we provide as the TEST_URL env variable, or
  default to a (manually-run) Ghost instance on port 2368
- also adds a `yarn test:browser` command to run the tests using the
  Playwright CLI, and a sample GitHub Action workflow which we can
  manually run with a site URL
- there's a lot more to add here in terms of test framework but this
  gets us started
2022-02-17 12:16:58 +01:00
Renovate Bot
9b4d61ef2e
Update dependency express to v4.17.3 2022-02-17 04:02:30 +00:00
Naz
f0bda014ab Fixed misconfigured SnapshotManager in e2e tests
refs https://github.com/TryGhost/Toolbox/issues/210

- After updating to the newest `@tryghost/express-test`, it's dependency `@tryghost/jest-snapshot` was missmatched with the one used in Ghost itself. This caused multiple instances of SnapshotManager class in the system, which is meant to be a singleton!
- The issue was causing following error to appear: "IncorrectUsageError: Unable to run snapshot tests, current test was not configured"
2022-02-17 11:01:15 +07:00
Naz
d79dab94f5 Changed test-framework assertion execution order
refs https://github.com/TryGhost/Toolbox/issues/210

- Having assertions executed in the declaration order using superagent has lead to many frustrating developer experiences. For example when status code assertion fails there was usually no additional context to investigate the failure further. In this situation having a "response body" assertion executed usually would give many more clues on the actual problem at hand.
- The order of the assertions has been changed from the order in which they were declared to the following one based on assertion type:
1. `exect`
2. `expectHeader`
3. `expectStatus`

- For more on this topic check the documentation: cfd6e88fe2/packages/express-test (assertion-execution-order)
2022-02-17 11:01:15 +07:00
Daniel Lockyer
08eaed152b Added yarn test:ci command
refs https://github.com/TryGhost/Toolbox/issues/208

- we currently run all test commands separately in CI and this can make
  it harder to replicate any issues we see in CI because we have to
  manually go and copy the order of the tests
- it's also nicer if there's just one command that runs so we can make
  changes globally to CI
- this commit adds a test:ci yarn command which will run the tests in
  order of speed/importance, with the -b AKA fail-fast flag so we
  don't have to wait for all tests to run before finding out about
  issues
- this also cleans up running unit tests in the DB matrix
2022-02-16 19:22:20 +01:00
Renovate Bot
6537ed1485
Update dependency @sentry/node to v6.17.9 2022-02-16 15:26:45 +00:00
Matt Hanley
4b47d376ec Merged v4.36.1 into main
v4.36.1
2022-02-16 15:25:03 +00:00
Daniel Lockyer
ffd66d5c57 v4.36.1 2022-02-16 15:23:42 +00:00
Kevin Ansfield
9debf27e62 🐛 Fixed "Invalid mobiledoc structure" errors the could occur when saving posts with header cards
refs https://github.com/TryGhost/Team/issues/1377

- bumped all packages that have a dependency on `@tryghost/kg-utils` to fix a bug in the `slugify()` utility that was throwing errors when the header or subheader was left blank in a header card
2022-02-16 15:16:10 +00:00
Kevin Ansfield
de644a25d4 🐛 Fixed "Invalid mobiledoc structure" errors the could occur when saving posts with header cards
refs https://github.com/TryGhost/Team/issues/1377

- bumped all packages that have a dependency on `@tryghost/kg-utils` to fix a bug in the `slugify()` utility that was throwing errors when the header or subheader was left blank in a header card
2022-02-16 14:44:33 +00:00
Renovate Bot
4ebbe90f17
Update dependency body-parser to v1.19.2 2022-02-16 05:19:22 +00:00
Renovate Bot
2b241b4e6a
Update dependency @sentry/node to v6.17.8 2022-02-15 16:28:10 +00:00
Daniel Lockyer
b2e04cce4b Bumped all Members packages
- we've just fixed up the use of `@tryghost/errors` and bumped some
  dependencies in all of our packages in Members
- this commit bumps all of those packages in Ghost so we can stay
  up-to-date
2022-02-15 13:58:55 +01:00
Naz
09bf5804ad Fixed e2e-framework to correctly compare headers
refs https://github.com/TryGhost/Toolbox/issues/209
refs https://github.com/TryGhost/Toolbox/issues/210

- Fixed request header processing by the e2e-framework where it failed to lowercase incoming header keys. This bug made it harder to test code paths which involve header checking, e.g. following code: `req.headers['stripe-signature']` would not get a correct value if the header was specified as Stripe-Signature
- Additional output to the status code assertions was added - this allows to have more context when an invalid response code comes back in a test.
2022-02-15 18:38:45 +07:00
Fabien "egg" O'Carroll
f88b6bd02f 🐛 Fixed Stripe checkout session urls being invalid
refs https://github.com/TryGhost/Team/issues/1322

Since the Members service is no longer started when Stripe is
reconfigured the url config used for checkout sessions was not updated.

This moves all of the default Stripe urls into the Stripe service, where
they will be updated as/when Stripe is connected/disconnected.
2022-02-15 12:50:07 +02:00
Renovate Bot
be5677cbd1
Update dependency eslint to v8.9.0 2022-02-14 02:20:41 +00:00
Renovate Bot
07ffe8fd94
Update dependency @sentry/node to v6.17.7 2022-02-11 18:01:11 +00:00
Daniel Lockyer
cc466edd8f v4.36.0 2022-02-11 16:00:27 +00:00
Renovate Bot
3681e1d86d Update dependency @tryghost/metrics to v1.0.5 2022-02-10 08:01:29 +01:00
Hannah Wolfe
c885dac30a
Removed chai + misc auth test cleanup
refs: https://github.com/TryGhost/Toolbox/issues/158

- We only use chai in a handful of places now, and it seems totally unnecessary
- Use assert instead
- Made other minor changes with a view to this being a reference aka "perfect" test suite
2022-02-09 21:14:31 +00:00
Fabien "egg" O'Carroll
21c43f3b10 🐛 Fixed 500 errors when cancelling subscriptions
no-issue

If Stripe subscriptions have manually been modified to contain more than
one price, then cancellation would fail, as Ghost/Members relies on
subscriptions only containing one price. This adds some handling so that
we do not error when cancelling.
2022-02-09 11:37:49 +02:00
Fabien 'egg' O'Carroll
88786f768b
Added validation for Tier prices
refs https://github.com/TryGhost/Team/issues/1319
refs https://github.com/TryGhost/Team/issues/521

This updates the members-api to explicitly validate Tier prices rather
than deferring to Stripe and using whichever errors they throw.
2022-02-09 11:04:58 +02:00
Renovate Bot
b1c2b923ce
Update dependency @sentry/node to v6.17.6 2022-02-08 20:37:28 +00:00
Hannah Wolfe
069c344495
Switched new e2e-framework to use our own snapshot lib (#14137)
refs TryGhost/Toolbox#158
refs TryGhost/Toolbox#129 (comment)

We now have @tryghost/jest-snapshot - a suite of utilities for using snapshots with mocha, should, etc
The @tryghost/express-test lib also uses it to provide chained snapshot assertions

This library was created because all the existing implementations I could find, including the in use @ethanresnick/chai-jest-snapshot
didn't properly support property matching. @ethanresnick/chai-jest-snapshot supposedly supported it, but the implementation was incorrect
and frequently lead to false test passes.

This library also has (after some back and forth) path resolution so that snapshots can live in a local __snapshots__ folder
2022-02-08 14:33:19 +00:00
Renovate Bot
0822a5b7a1 Update dependency @tryghost/request to v0.1.14 2022-02-08 11:08:48 +01:00
Renovate Bot
91b5c09f5e Update dependency @sentry/node to v6.17.5 2022-02-08 07:43:00 +00:00
Renovate Bot
1852521fca Update dependency cssnano to v5.0.17 2022-02-07 20:00:45 +01:00
Kevin Ansfield
f410893f3e 🐛 Fixed header cards not being linkable with #header-title
refs https://github.com/TryGhost/Team/issues/1316

Updates header card renderer so the `<h2>` and `<h3>` elements have slugified titles set on their `id` attributes to allow in-page and external #header-title anchor links.

- bumps `@tryghost/kg-default-cards` including the header card id fix
- bumps other `@tryghost/kg-*` packages that were released simultaneously - contains dependency updates and switch to `slugify()` from `@tryghost/kg-utils`
2022-02-07 18:52:18 +00:00