-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
✅ Fixes 2 unit tests #14561
✅ Fixes 2 unit tests #14561
Conversation
sandbox.stub(analytics, 'predefinedConfig_').value( | ||
{ | ||
'foo': { | ||
'triggers': { |
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.
Lack of this was causing error at https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/0.1/amp-analytics.js#L248
root.listenRoot(spec, null, null, null); | ||
allowConsoleError(() => { | ||
// Expect user().error(TAG, | ||
// 'visiblePercentageThresholds entry invalid min/max value') |
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.
root.listenRoot(spec, null, null, null); | ||
allowConsoleError(() => { | ||
// On the [10, 10] only, again expect user().error(TAG, | ||
// 'visiblePercentageThresholds entry invalid min/max value') |
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.
Same as above
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.
Comment should say "[10, 10] and [30, 30] only". I noticed this after it was merged, so corrected in #14576
Fixes the 2 unit tests assigned to me in #14336
In the first test, we were getting a console error which was not necessary, so fixed the code to not cause that.
In the second test, we were testing an error condition which was expected to generate a console error, so wrapped that in allowConsoleError()