Ghost/ghost/core/test
Simon Backx b545dfa0cc
Improved recommendation controller structure (#18208)
fixes https://github.com/TryGhost/Product/issues/3900

1. The service never returns a Recommendation Entity, but always plain
objects (which for now is the same as Recommendation without the
methods).
2. Updated the controller to be more readable and minimal (we keep this
controller, in addition to the existing endpoints and serializers)
- The controller does minimal validation and allows for type checking
(so we get compile time errors in case the service expects new fields)
- The controller uses the `UnsafeData` class to easily validate the
input from requests, and throws appropriate errors (with correct field
descriptions — "Expected a string at recommendations.0.title") without
too much boilerplate code. In addition the interface is typed, so we get
compile errors if there are breaking changes in the service.
- Removed `EntityWithIncludes`, since we now use plain objects, we
inject the relations directly into those plain objects (with some new
types that add type support)
- Added new tests to make sure that edits only affect the given fields,
and never undefined fields
2023-09-18 14:36:49 +00:00
..
e2e-api Improved recommendation controller structure (#18208) 2023-09-18 14:36:49 +00:00
e2e-browser Added Playwright tests for donations (#17699) 2023-08-15 15:20:18 +02:00
e2e-frontend Added newsletter payload serializer 2023-09-13 13:18:43 +08:00
e2e-server Updated to use assert/strict everywhere (#17047) 2023-06-21 09:56:59 +01:00
e2e-webhooks Trimmed down Members Admin API response data 2023-09-13 13:18:43 +08:00
integration Added recommendation events tables (#18084) 2023-09-13 17:18:40 +02:00
regression Added new setting to enable Recommendations (#17856) 2023-08-30 08:56:21 +00:00
unit Updated page metadata to use author image over cover image (#17689) 2023-09-15 16:07:06 +02:00
utils Added new setting to enable Recommendations (#17856) 2023-08-30 08:56:21 +00:00
.eslintignore Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
.eslintrc.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00