Commit Graph

11 Commits

Author SHA1 Message Date
Naz
a58e9bb61c Added default options to regression test utils
refs https://github.com/TryGhost/Toolbox/issues/152

- Allows to override boot options form regression test level - needed in some cases for vhost tests
2021-12-06 21:28:53 +13:00
Naz
9dc096cb15 Fixed api vs frontend test suites
refs 3c7a8dead4

- The tests needed adjustments with the native boot mechanism.
- The number of returned posts changed in the test resutls because duing native boot we also insert fixtures which add to the number of initial posts
- The vhost regression suite is still failing and I had no strength to figure out why. The redirect it fails with makes no sense, the clue here is that the test doesn't fail when running in isolation, so probably has to do with some leftover overrides from the previous test cases.
2021-12-06 21:28:53 +13:00
Naz
9e53f36c42 Fixed regression test suite stubs
refs 3c7a8dead4

- The boot process has been using an asyc method to load the routes file, which is the case now for these tests since the switch to raw boot method instead of mimicking it manually
2021-12-06 21:28:53 +13:00
Naz
51a4a65eec Enabled frontend-only boot for mock-express tests
refs 3c7a8dead4

- Simplifies the state initialization code significantly and reuses native boot mechanism instead of mimicking it (it was a headache to maintain with all the internal services moving around)
2021-12-06 21:28:53 +13:00
Naz
57de4aca71 Fixed mock-express test setup
refs https://github.com/TryGhost/Toolbox/issues/152

- The tests would fail without these initializations when run in isolation
2021-12-01 18:56:29 +04:00
Naz
f0b8e9693f Fixed loadRouteSettingsSync stubs
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings
refs e457fd5fe0 (diff-b292e8480eee007786cc602f55ed05006a06b8da9fe6934d51fbef8328013278R36)

- Because "loadRouteSettingsSync" method is now a getter function these stubs had to be changed to use a different syntax
- It's a lot of maintenance to do such renames, so if someone has to touch this exact place again it might be worth abstracting this mocking into a separate utility of some sort.
2021-11-24 05:32:20 +13:00
Naz
f0ae7592cf Removed unneeded mocks
refs https://github.com/TryGhost/Toolbox/issues/135

- These mocks were failing to execute but didn't make any difference in the test outcome
2021-11-22 21:56:32 +13:00
Naz
149c100b4c Fixed frontend initialization in "mock-express" tests
refs https://github.com/TryGhost/Toolbox/issues/135

- Without sensible defaults the web app was not initializing either the backend nor the frontned parts of the application. Fixed the defaults so the problem doesn't happen again and optimized mock-express-style initialization to only initialize the frontend routing
2021-11-22 21:56:32 +13:00
Hannah Wolfe
b736a32eb9
Fixed mock-express style tests
- custom theme settings have to be initialised before the theme service
2021-10-25 09:56:54 +01:00
Hannah Wolfe
2756af83bb
Colocated mock-express style utilities 2021-10-20 13:18:35 +01:00
Hannah Wolfe
b804dcec30
Renamed and moved "express mock" style tests
- Clarifying that these tests use a different pattern and we're not sure if it's staying or going
2021-10-20 13:18:34 +01:00