-
Notifications
You must be signed in to change notification settings - Fork 4.8k
chore(aria): extract compareSnapshots #37987
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
chore(aria): extract compareSnapshots #37987
Conversation
Test results for "MCP"2570 passed, 108 skipped Merge workflow run. |
Test results for "tests 1"4 flaky47161 passed, 815 skipped Merge workflow run. |
| } else { | ||
| let previous = typeof previousChild !== 'string' ? previousChild : undefined; | ||
| if (child.ref) | ||
| previous = previousByRef.get(child.ref); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I read it, I can reorder child nodes and it'll yield the truthy result, yet you have it tested. Why does it work?
| return aKeys.length === bKeys.length && aKeys.every(k => a.props[k] === b.props[k]); | ||
| } | ||
| // Returns whether ariaNode is the same as previousNode. | ||
| const visit = (ariaNode: AriaNode, previousNode: AriaNode | undefined): boolean => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm growing increasingly unsympathetic towards rendering via delta. I think we should have a simple code path that does a simple thing and a complex code path that does complex things. If we need helper functions for it, let's introduce them beforehand.
| const escapedKey = indent + '- ' + yamlEscapeKeyIfNeeded(key); | ||
| const inCursorPointer = renderCursorPointer && !!ariaNode.ref && hasPointerCursor(ariaNode); | ||
| const singleInlinedTextChild = getSingleInlinedTextChild(ariaNode); | ||
| // Replace the whole subtree with a single reference when possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a part of compareSnapshots?
This reverts commit 1a06851.
No description provided.