-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
report(util): ✅ audits should be in Passed Audits #5963
Conversation
…-category render tests
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.
lgtm % small tweak
@@ -140,7 +142,7 @@ describe('PerfCategoryRenderer', () => { | |||
const diagnosticSection = categoryDOM.querySelectorAll('.lh-category > .lh-audit-group')[2]; | |||
|
|||
const diagnosticAudits = category.auditRefs.filter(audit => audit.group === 'diagnostics' && | |||
audit.result.score !== 1 && audit.result.scoreDisplayMode !== 'not-applicable'); | |||
audit.result.score < PASS_THRESHOLD && audit.result.scoreDisplayMode !== 'not-applicable'); |
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.
can just use Util.PASS_THRESHOLD
instead of the local declaration above.
i think that'll be fine despite all the jsdom beforeEach bs. but holler if its stupid.
@@ -140,7 +140,8 @@ describe('PerfCategoryRenderer', () => { | |||
const diagnosticSection = categoryDOM.querySelectorAll('.lh-category > .lh-audit-group')[2]; | |||
|
|||
const diagnosticAudits = category.auditRefs.filter(audit => audit.group === 'diagnostics' && | |||
audit.result.score !== 1 && audit.result.scoreDisplayMode !== 'not-applicable'); | |||
audit.result.score < Util.PASS_THRESHOLD && |
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.
@paulirish was there a historical reason for this not just being !Util.showAsPassed(audit.result)
?
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.
nope. that sounds great.
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.
👍 Sorted in 6a1715a.
@@ -140,7 +140,8 @@ describe('PerfCategoryRenderer', () => { | |||
const diagnosticSection = categoryDOM.querySelectorAll('.lh-category > .lh-audit-group')[2]; | |||
|
|||
const diagnosticAudits = category.auditRefs.filter(audit => audit.group === 'diagnostics' && | |||
audit.result.score !== 1 && audit.result.scoreDisplayMode !== 'not-applicable'); | |||
!Util.showAsPassed(audit.result) && | |||
audit.result.scoreDisplayMode !== 'not-applicable'); |
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.
oh, sorry, should have put the comment below this line. showAsPassed()
includes the not-applicable
check :)
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.
That's my bad; I should have noticed the check showAsPassed. 👍 Fixed in latest commit.
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.
LGTM!
Util.showAsPassed()
now default compares toRATINGS.PASS.minScore
; updated the perf-category render tests to check against the addedPASS_THRESHOLD
const. Resolves #5959With PR
Without PR