Repository navigation
fix(visualizer): export an audit with a rating and no value as an audit - #435
Merged
Merged
Conversation
Copy as Markdown treated every result with a rating as a metric, so an audit such as Script-Loading came out as a heading with "undefined" and none of its issues or items, and a result whose unit is a score threw before copying anything. The export picks its format with detectRenderer, as the page picks its view. detectRenderer moves to its own module so that the export can import it. A result the page shows as JSON is exported as JSON instead of "No issues found". The tests export the 114 result fixtures and fail on any "undefined" or "NaN".
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 of 5 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Copy as Markdown of the visualizer treated every result with a rating as a metric. An audit such as Script-Loading, which has a rating and no value, came out as a heading with
undefinedand none of its issues or items, and a result whose unit is a score threw before copying anything.detectRenderer, as the page picks its view.detectRenderermoves fromindex.jsxto its own module, so that the export can import it.Test plan
## Script-Loading — undefined ⚠️ needs-improvement.npm run test:componentslocally: 298 of 298. One case exports the 114 result fixtures and fails on anyundefinedorNaN.npm run lintlocally./visualizer: pasted four results, clicked Copy as Markdown and read the clipboard, with no page errors. Script-Loading comes with its 2 issues and its table of 3 items, CLS as## CLS — 0.0638 ✅ good, a score without a value copies, and a result with neither issues nor items comes as a JSON block.