Skip to content
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

Merged
merged 4 commits into from
Sep 8, 2018

Conversation

justinribeiro
Copy link
Contributor

@justinribeiro justinribeiro commented Sep 5, 2018

Util.showAsPassed() now default compares to RATINGS.PASS.minScore; updated the perf-category render tests to check against the added PASS_THRESHOLD const. Resolves #5959

With PR
image

Without PR
image

@justinribeiro justinribeiro changed the title report(utils): ✅ audits should be in Passed Audits report(util): ✅ audits should be in Passed Audits Sep 5, 2018
Copy link
Member

@paulirish paulirish left a 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');
Copy link
Member

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 &&
Copy link
Member

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)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. that sounds great.

Copy link
Contributor Author

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');
Copy link
Member

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 :)

Copy link
Contributor Author

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.

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@paulirish paulirish merged commit ea1cb34 into GoogleChrome:master Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants