Commit Graph

15295 Commits

Author SHA1 Message Date
Hannah Wolfe
2ea7d5432b
Updated casper test fixture to latest version
closes: https://github.com/TryGhost/Toolbox/issues/193

- Our Casper fixture was several years out of date.
- I'd already updated the ghost-api to point to the latest API version, which was the main difference
- This makes sure the full fixture is up to date and correct, and therefore that we're truly testing if Ghost right now works
- It also adds instructions for how to update it in future

GOTCHA: the mock-express-style tests are failing if the API difference between test-theme and casper are different
- I've tried to look into why this is - it's something to do with the overridden route settings not working properly if the API version changes
- Given that we may not keep this style of testing AND we are definitely not keeping API versions, I'm ignoreing this for now
- To get around it, I'm setting both themes to be v4 API, so that Casper is exactly as in main
2022-01-25 14:10:53 +00:00
Hannah Wolfe
a5655c4a22
Removed unnecessary files from casper fixture
refs: https://github.com/TryGhost/Toolbox/issues/193

- The Casper fixture in the codebase is copied to a tmp folder structure every single time we start Ghost in an e2e test
- We shouldn't keep files here that don't actually get used!
- The files I'm removing are src files, used for building, but we already have the built files
2022-01-25 14:07:59 +00:00
Fabien "egg" O'Carroll
60777ac7fb Cleaned up Products API add & edit
refs https://github.com/TryGhost/Team/issues/1291

This is cleanup from the initial implementation.
2022-01-25 15:45:20 +02:00
Daniel Lockyer
2122a47ce0 Added MySQL 8 to CI tests
refs https://github.com/TryGhost/Toolbox/issues/181

- we officially support MySQL 8 but we don't run tests for it -- oops
- this commit adds MySQL 8 to the DB matrix in CI tests
- I had to switch to a fork of the `mysql-action` repo so I could get
  the native authentication plugin working, but I expect to revert this
  once we've merged support for mysql2
2022-01-25 12:23:15 +00:00
Thibaut Patel
b55b9741e5 Updated the /members/events route to support filters
refs https://github.com/TryGhost/Team/issues/1277

- The filters `type`, `data.created_at` and `data.member_id` are available and working as expected
2022-01-25 12:40:38 +01:00
Hannah Wolfe
bd9f720a70
Upgraded remaining theme fixtures to canary API
refs: https://github.com/TryGhost/Toolbox/issues/168

- Upgraded the remaining themes to be pinned to the canary API
- This required one minor fix because the edit URL has changed for authors in v4/canary
- I also ripped out everywhere that the theme ghost-api version was being pinned to canary, as this was unreliable and only happening in a few places
- It's also going to be unnecessary code as soon as we finish changing to only having one API version
2022-01-24 21:55:13 +00:00
Hannah Wolfe
8319d73b0a
Fixed timing-dependent content gating test
- This test failed for me intermittently because the posts would be out of order
- I assume this is due to my super-powered M1 mac 😂
- This rewrite only aims to remove the dependency between the insertion order and the output order
- Everything else should be the same, and it still tests that the posts that are meant to be members only are exactly that
2022-01-24 21:55:12 +00:00
Renovate Bot
d3dfa1e5a1 Update dependency @tryghost/members-api to v4.7.1 2022-01-24 20:38:39 +00:00
Renovate Bot
ca4f6bdeda
Update dependency @sentry/node to v6.17.1 2022-01-24 18:29:58 +00:00
Daniel Lockyer
83fee77ed0
Re-added dependency after erroneous deletion
refs a2c44efa6a

- I accidentally removed the `@tryghost/members-importer` dependency during a release merge
- this commit re-adds the dependency
2022-01-24 16:07:28 +00:00
Daniel Lockyer
a2c44efa6a
Merged v4.33.1 into main
v4.33.1
2022-01-24 16:03:16 +00:00
Daniel Lockyer
9f897afea4 v4.33.1 2022-01-24 15:59:59 +00:00
Daniel Lockyer
1559961f66 Updated Admin to v4.33.1 2022-01-24 15:59:59 +00:00
Fabien "egg" O'Carroll
e556951dc9 🐛 Fixed webhook handling of Stripe Checkout
no-issue

Handling Stripe Checkout webhooks was failing to send emails to customers
because of a faulty reference. This updates the Webhook Controller to fix
that.
2022-01-24 17:50:55 +02:00
Fabien "egg" O'Carroll
91df910dbb 🐛 Fixed crashing on boot with revoked Stripe keys
no-issue

The refactor of Stripe boot logic missed catching any errors from the
migrations running or the webhooks initialising. This adds try/catches
to the services so that we can log the errors.
2022-01-24 17:50:55 +02:00
Renovate Bot
90ca56a4f4
Update dependency mocha to v9.2.0 2022-01-24 15:00:26 +00:00
Renovate Bot
287a2be115
Update dependency @sentry/node to v6.17.0 2022-01-24 12:26:10 +00:00
Hannah Wolfe
2768f5bb72
Removed ancient Casper fixture
refs: https://github.com/TryGhost/Toolbox/issues/168

- The fixture represented Casper at Ghost version 1.0 which pre-dated the introduction of the posts_per_page config in package.json
- When Casper was upgraded to 2.0 in the fixtures, the lack of pagination broke the e2e tests for pagination
- This change introduces proper code to stub and override posts_per_page rather than keeping and using the old casper-1.4 fixture
- It also required me to remove a handful of CSS-based checks which are no longer true in the new theme version, but also didn't really add anything to the tests
2022-01-24 12:24:51 +00:00
Fabien 'egg' O'Carroll
01f30eb632
Included benefits with theme product data (#14051)
refs https://github.com/TryGhost/Team/issues/1079

These were missing when benefits were added to products, and will allow
theme developers to make more useful custom subscribe pages.
2022-01-24 13:55:25 +02:00
renovate[bot]
410c1d54cd
Update dependency @tryghost/members-offers to v0.10.6 (#14041)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-24 13:45:39 +02:00
Fabien 'egg' O'Carroll
a3182a7664
Removed Stripe Service regression test (#14050)
no-issue

This test should have always been a unit test, but it now no longer
serves a purpose, as we do not rely on the event being emitted - it
would also not break Ghost if the event _was_ emitted, so we should not
be testing for that.
2022-01-24 13:35:19 +02:00
Fabien "egg" O'Carroll
3ff3da1d99 Removed archived Tiers from Portal display
refs https://github.com/TryGhost/Team/issues/1252

In order to ensure that archived Tiers are not selected to be shown in
Portal, both after they archived, and after they've been un-archived -
we need to persist this information to storage. This is currently done
via the `portal_products` setting.

The reasoning behind this is so that un-archiving a Tier doesn't modify
Portal settings without the user being aware.
2022-01-24 13:15:46 +02:00
Fabien 'egg' O'Carroll
db4da54265
Removed archived Tiers from theme data (#14049)
refs https://github.com/TryGhost/Team/issues/1252

In order to allow existing subscribe pages to continue working without
an extra flag, we're going to filter out the archived tiers.
2022-01-24 12:47:24 +02:00
Hannah Wolfe
034f7d9a55
Renamed & cleaned up price data test theme fixture
refs: https://github.com/TryGhost/Toolbox/issues/168

- Having large theme fixtures makes tests run slower, so we're working to reduce them
- This fixture was a full copy of a very old version of Casper, but all we needed was a handful of files so that the tests can run
- This theme is also used for testing members, not just price data so I've renamed it for clarity
- The remaining files is the bare minimum we need to test these features
2022-01-24 09:55:21 +00:00
Fabien "egg" O'Carroll
69483e2917 Restricted archived Tiers from complementary subs
refs https://github.com/TryGhost/Team/issues/1252

Although Archived Tiers cannot be signed up to via Stripe, we also need
to stop them from being assigned through a complementary subscription.
2022-01-24 11:48:33 +02:00
renovate[bot]
4bff74823e
Update dependency @tryghost/members-ssr to v1.0.19 (#14042)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-24 11:24:50 +02:00
Renovate Bot
76a9a2f518 Update dependency cssnano to v5.0.16 2022-01-24 08:39:23 +00:00
Hannah Wolfe
2b6fcf9a8f
Improved naming of mock express tests
- these used incorrect case and unnecessary nesting
- they are now consistently named with our preferred patterns
2022-01-21 20:37:48 +00:00
Hannah Wolfe
9d8089a748
Removed deprecated routes.yaml data format
refs: https://github.com/TryGhost/Ghost/issues/10434
refs: https://github.com/TryGhost/Ghost/pull/10449
refs: https://github.com/TryGhost/Ghost/pull/10559

- We originally had a weird structure returned for data keys in routes.yaml.
- To the best of my knowledge this was never desired or really used
- I'm removing it now simply because I'm trying to remove all references to v2/v3 in tests, and this had a comment saying it was deprecated in v3
- I could have changed the comment to be a proper @deprecated comment and leave this til we rewrite dynamic routing
- However it's weird and confusing and I believe entirely unused - so getting rid is way way better
2022-01-21 20:16:43 +00:00
Thibaut Patel
817e556ea6 Updated the /members/event filtering logic
refs https://github.com/TryGhost/Team/issues/1277

- Enabled the `filter` attribute on the route.
- The events are now filtered in-memory instead of in the database.
- This fixes a wrong logic where the API user would have to know the internal event structure.
2022-01-21 18:35:02 +01:00
Daniel Lockyer
bb10fedacd v4.33.0 2022-01-21 16:00:32 +00:00
Daniel Lockyer
1bd0df3905 Updated Admin to v4.33.0 2022-01-21 16:00:31 +00:00
Hannah Wolfe
fc6d60e36d
Updated test UrlUtils to use canary by default
refs: https://github.com/TryGhost/Toolbox/issues/168

- This file was pinning various tests to v3

We're going to be dropping the idea of having multiple versions of the API in each Ghost version.
Because this has not achieved the goal of making it easier to make breaking changes, but it has
created an ordinate amount of technical debt and maintenance overhead.

As we know this is going away in the next major, there is no benefit to us constantly running tests
that check if those versions still work, especially given how long they take.

Instead we're starting work to ensure that all of our test work on canary, and that canary has
excellent test coverage so that we can be sure that our one API version works really well and that
any changes, no matter how subtle are deliberate, tracked and understood.
2022-01-21 15:12:27 +00:00
Hannah Wolfe
4c8ff38a44
Updated misc unversioned tests to run on canary
refs: https://github.com/TryGhost/Toolbox/issues/168

- All of our unversioned tests should be running against canary already
- These tests are erroneously running on the wrong version

We're going to be dropping the idea of having multiple versions of the API in each Ghost version.
Because this has not achieved the goal of making it easier to make breaking changes, but it has
created an ordinate amount of technical debt and maintenance overhead.

As we know this is going away in the next major, there is no benefit to us constantly running tests
that check if those versions still work, especially given how long they take.

Instead we're starting work to ensure that all of our test work on canary, and that canary has
excellent test coverage so that we can be sure that our one API version works really well and that
any changes, no matter how subtle are deliberate, tracked and understood.
2022-01-21 15:11:48 +00:00
Hannah Wolfe
12e8c974a1
Cleaned up weird refs to versions in tests
refs: https://github.com/TryGhost/Toolbox/issues/168

- These are all places where we reference an API version like v2 or v3 but it's not actually
used or relevant.
- The aim is to get rid of all mentions of these old versions to make it clearer that we're only running tests on canary
2022-01-21 15:10:03 +00:00
Hannah Wolfe
e47b55b466
Removed some hidden v2 and v3 tests
refs: https://github.com/TryGhost/Toolbox/issues/168

- These are all test files I missed in ffcd3fbe313b4a413833da9a7473376cb21246fd

We're going to be dropping the idea of having multiple versions of the API in each Ghost version.
Because this has not achieved the goal of making it easier to make breaking changes, but it has
created an ordinate amount of technical debt and maintenance overhead.

As we know this is going away in the next major, there is no benefit to us constantly running tests
that check if those versions still work, especially given how long they take.

Instead we're starting work to ensure that all of our test work on canary, and that canary has
excellent test coverage so that we can be sure that our one API version works really well and that
any changes, no matter how subtle are deliberate, tracked and understood.
2022-01-21 15:07:17 +00:00
renovate[bot]
b6c0f8bddd
Update dependency @tryghost/express-dynamic-redirects to v0.2.4 (#14023)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-21 15:56:51 +02:00
Thibaut Patel
bb24177149 Added the option to filter events from the /members/events endpoint
refs https://github.com/TryGhost/Team/issues/1277

- Filter events using the usual `filter` property
- Fixed a bug that was in `members-api@4.3.0`
2022-01-21 14:56:36 +01:00
Hannah Wolfe
7102c0ca82
Removed all the obvious tests for v2 & v3
refs: https://github.com/TryGhost/Toolbox/issues/168

We're going to be dropping the idea of having multiple versions of the API in each Ghost version.
Because this has not achieved the goal of making it easier to make breaking changes, but it has
created an ordinate amount of technical debt and maintenance overhead.

As we know this is going away in the next major, there is no benefit to us constantly running tests
that check if those versions still work, especially given how long they take.

Instead we're starting work to ensure that all of our test work on canary, and that canary has
excellent test coverage so that we can be sure that our one API version works really well and that
any changes, no matter how subtle are deliberate, tracked and understood.
2022-01-21 12:49:05 +00:00
Hannah Wolfe
7c7e38f8e8
Fixed overly specific default routes test
- This test failed after updating Casper, because Casper has changed how it outputs next/previous type posts at the bottom
- This test was overly specific. If we want to test if the next and previous posts are output, we should have a particular assertion/test that clearly does that
- I've changed the test to not use cheerio and just do a couple of checks to make sure that head and body contain something sensible
- This will still be specific to the fixtures though
2022-01-21 12:31:45 +00:00
Fabien "egg" O'Carroll
ca2a8ba464 Restricted updating Subscription to archived Tier
refs https://github.com/TryGhost/Team/issues/1252

Archived tiers should be restricted from _any_ "new" subscriptions,
including existing ones. They are essentially disabled.
2022-01-21 14:11:46 +02:00
renovate[bot]
1b1abe3005
Update dependency @tryghost/members-api to v4.3.0 (#14013)
refs https://github.com/TryGhost/Team/issues/1277
refs https://github.com/TryGhost/Team/issues/1252

- Restrict creating new checkout session with archived Tiers
- Allowed event timeline to have additional filters passed

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Thibaut Patel <thibaut@ghost.org>
2022-01-21 13:43:08 +02:00
Renovate Bot
a43dd4fe60 Update dependency @tryghost/settings-path-manager to v0.1.3 2022-01-21 11:03:28 +00:00
Renovate Bot
d0507467ad Update dependency @tryghost/social-urls to v0.1.28 2022-01-21 10:33:50 +00:00
Renovate Bot
d0b27d45bf Update dependency @tryghost/color-utils to v0.1.6 2022-01-21 10:07:48 +00:00
Renovate Bot
dcc9a57f6a Update dependency @tryghost/helpers to v1.1.55 2022-01-21 10:07:37 +00:00
Renovate Bot
91f2416ef1 Update dependency @tryghost/string to v0.1.22 2022-01-21 10:07:18 +00:00
Renovate Bot
2b9847a91f Update dependency @tryghost/url-utils to v2.0.5 2022-01-21 10:07:07 +00:00
renovate[bot]
7c76c429b1
Update dependency @tryghost/members-importer to v0.4.1 (#14027)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-20 20:56:13 +02:00
renovate[bot]
b21e1426de
Update dependency @tryghost/members-stripe-service to v0.6.3 (#14030)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-01-20 20:54:54 +02:00