-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Revert "Remove hasAds from service configs"" #7299
Revert "Revert "Remove hasAds from service configs"" #7299
Conversation
I've recently learned that we are using manual mocks for our service context provider. I believe we can also do something similar for the toggles context provider so that in our test environment we use our hardcoded toggle values rather than making any api requests. |
I ended up just using ToggleContext.Provider with a mocked set of values rather than mocking the implementation of ToggleContextProvider (like
That does not seem officially resolved: jestjs/jest#2070 Passing a mocked set of values means that we do not have to call the fetch api logic in the TogglesContextProvider. |
…github.com:bbc/simorgh into revert-7294-revert-7220-remove-has-ads-from-config
…rt-7220-remove-has-ads-from-config
…rt-7220-remove-has-ads-from-config
…github.com:bbc/simorgh into revert-7294-revert-7220-remove-has-ads-from-config
…github.com:bbc/simorgh into revert-7294-revert-7220-remove-has-ads-from-config
…rt-7220-remove-has-ads-from-config
@@ -9,4 +10,17 @@ describe('CanonicalAds Ads', () => { | |||
<CanonicalAdBootstrapJs />, | |||
); | |||
}); | |||
|
|||
describe('Assertions', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea on moving the test to this file. Do they pass now on Jenkins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup everything seems stable now! Travis is being a bit weird but I think it's just some issues on their end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! There are some conflicts that need to be resolved 🔧
…rt-7220-remove-has-ads-from-config
LGTM. |
…rt-7220-remove-has-ads-from-config
Reverts #7294
We have had to revert and block this on #6866, as we had a race condition when setting up the ads bootstrap javascript.
Overall change:
Remove the hasAds field from the service config files and ensure we're just checking the ads toggle from the config endpoint.
Code changes: