Commit Graph

7 Commits

Author SHA1 Message Date
Naz
3a974f6e4e Added default values for Stripe config in tests
refs https://github.com/TryGhost/Toolbox/issues/214

- These variables need to be present in the configuration during the Ghost's boot time initialization, which caused a need to remember to mock settings cache before agent initialization.
- By moving the values into default settings config it removes the need to do any work during test environment setup. Yey!
- We should put default values in to test-specific settings-defaults.json In similar situations. Specifically, when we find a need to mock settings cache to be able to start Ghost instance in a certain state
2022-02-21 20:06:20 +13:00
Fabien 'egg' O'Carroll
9c5c41b927
🐛 Fixed welcome pages not working for "subscribe" links (#14176)
- Fixed test fixtures so that members with subscriptions also have products/tiers
- Fixed test fixtures so that default&free tiers can be updated for tests
- Added tests for the signin functionality and welcome page redirects
- Extended `setupStripe` to setup other Members settings - this needs some more
  thought around how we proceed
2022-02-20 16:02:42 +02:00
Hannah Wolfe
a064067154
Fixed logic error in labs mock
- the previous logic only allowed one flag to be mocked at a time because it kept recalling sinon.stub
- now it's possible to mock multiple flags with different settings as we always just add to the same stub
2022-02-18 10:13:30 +00:00
Fabien 'egg' O'Carroll
133a41c256
Added scaffolding for testing Members with Stripe (#14142)
refs https://github.com/TryGhost/Team/issues/1338

This adds some initial scaffolding to make it easier to test Members with Stripe
 - `mockStripe` method to disable the network, so we can use nock to intercept
Stripe API calls
- `setupStripe` method to be called _before_ getting an agent so that Stripe is 
configured
- `getMembersAPIAgent` to get an agent for the Members frontend API
2022-02-15 15:08:58 +02:00
Hannah Wolfe
83aa35241a
Added mockLabsDisabled to e2e framework
- Can now easily mock labs flags as enabled or disabled using mockManager
- Updated some bits of code that directly mocked labs
- Aside: improved error thrown when things go wrong booting Ghost
2022-02-10 12:10:31 +00:00
Hannah Wolfe
0711555cbd
Added mockLabsEnabled helper
refs: https://github.com/TryGhost/Toolbox/issues/158

- Cleans up the different ways that labs could be mocked into a simple helper
2022-02-08 20:31:02 +00:00
Hannah Wolfe
2c14923bb6
Renamed mock-utils to mock-manager
refs: https://github.com/TryGhost/Toolbox/issues/158

- continuing to try to make the framework as clean as possible
2022-02-08 20:12:09 +00:00