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

core(fr): filter out manual-only categories #12367

Merged
merged 2 commits into from Apr 19, 2021

Conversation

patrickhulce
Copy link
Collaborator

Summary
Improves the filtering of categories in Fraggle Rock to remove categories that consist only manual audits. This eliminates the UX oddity that you'd run timespan mode and get a ? score for accessibility category because all its real audits were snapshot audits.

Related Issues/PRs
ref #11313

@patrickhulce patrickhulce requested a review from a team as a code owner April 15, 2021 19:30
@patrickhulce patrickhulce requested review from adamraine and removed request for a team April 15, 2021 19:30
@google-cla google-cla bot added the cla: yes label Apr 15, 2021
@@ -48,16 +50,32 @@ function filterCategoriesByAvailableAudits(categories, availableAudits) {
if (!categories) return categories;

const availableAuditIds = new Set(availableAudits.map(audit => audit.implementation.meta.id));
const manualAuditIds = new Set(
Copy link
Member

Choose a reason for hiding this comment

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

nit: Would a single auditIdToAuditMeta map also work? I don't think you need to change anything unless you see us adding another filter in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure I'll refactor 👍

Comment on lines +120 to +123
expect(filtered).not.toMatchObject({
timespan: {},
navigation: {},
});
Copy link
Member

Choose a reason for hiding this comment

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

Nice way of enforcing this

if (!meta) return false;
return meta.scoreDisplayMode === Audit.SCORING_MODES.MANUAL;
});

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that line is empty of course it's covered...

go home codecov you're drunk 😆

image

(I'm assuming this is some source mapping issue because line 66 can't be covered, it's a make TS happy check that's impossible, EDIT: I take it back the line is obviously covered it's just the branch that can't. dunno what's going on)

@patrickhulce patrickhulce merged commit e2c9e2d into master Apr 19, 2021
@patrickhulce patrickhulce deleted the fr_filter_empty_categories branch April 19, 2021 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants