Commit Graph

5 Commits

Author SHA1 Message Date
Naz
5dd3752f15 Added test coverage for is over limit check
refs https://github.com/TryGhost/Team/issues/587

- There was no test coverage for MaxLimit's errorIfIsOverLimit check. Added basic test to make sure upcoming modifications don't break existing functionality
2021-04-01 18:10:07 +13:00
Naz
3bcc4256f5 Grouped MaxLimit test cases into describe groups
refs https://github.com/TryGhost/Team/issues/587

- Clenup before adding even more test coverage
2021-04-01 18:03:32 +13:00
Naz
73e7319406 Added optional max limit override to errorIfWouldGoOverLimit
refs https://github.com/TryGhost/Team/issues/587

- The optional {max} passed as an option allows to override currently configured limit and do a theoretical new limit check. For example:  check if the max limit will be exceeded if the limit changes (user changes plans)
2021-04-01 17:59:52 +13:00
Naz
57e24b3677 Added incorrect 'max' usage error to MaxLimit
refs https://github.com/TryGhost/Team/issues/587

- When the 'max' configuration is missing the instance of the class breaks when used unexpectedly. Followed similar approach to currentCountQuery check  by failing fast in the constructor
2021-04-01 17:20:56 +13:00
Naz
299d3e3bd4 Added test coverage for max limit class
refs https://github.com/TryGhost/Team/issues/587

- Test were missing for class initialization and around how the limit currently works.
- Before extending it's behavior throught its valuable to cover current functionality to not accidentally break anything
2021-04-01 17:17:45 +13:00