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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lighthouse-core/report/html/renderer/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ class Util {
case 'numeric':
case 'binary':
default:
// Numeric audits that are within PASS_THRESHOLD will still show up with failing.
// For opportunities, we want to have them show up with other failing for contrast.
// For diagnostics, we sort by score so they'll be lowest priority.
return Number(audit.score) === 1;
return Number(audit.score) >= RATINGS.PASS.minScore;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,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');
!Util.showAsPassed(audit.result));
const diagnosticElements = diagnosticSection.querySelectorAll('.lh-audit');
assert.equal(diagnosticElements.length, diagnosticAudits.length);
});
Expand All @@ -150,8 +150,7 @@ describe('PerfCategoryRenderer', () => {
const passedSection = categoryDOM.querySelector('.lh-category > .lh-passed-audits');

const passedAudits = category.auditRefs.filter(audit =>
audit.group && audit.group !== 'metrics' &&
(audit.result.score === 1 || audit.result.scoreDisplayMode === 'not-applicable'));
audit.group && audit.group !== 'metrics' && Util.showAsPassed(audit.result));
const passedElements = passedSection.querySelectorAll('.lh-audit');
assert.equal(passedElements.length, passedAudits.length);
});
Expand Down