Skip to content

Commit

Permalink
report(util): ✅ audits should be in Passed Audits (#5963)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinribeiro authored and paulirish committed Sep 8, 2018
1 parent 6656521 commit ea1cb34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
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

0 comments on commit ea1cb34

Please sign in to comment.