-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat(toMatchAriaSnapshot): add exact saving option #38075
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
base: main
Are you sure you want to change the base?
feat(toMatchAriaSnapshot): add exact saving option #38075
Conversation
Fixes microsoft#38074, references microsoft#38074.
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.
Thank you for your contribution. We always ask that people file issues first so we can triage and decide whether or not a PR is warranted, but in this case we do think this is something worth implementing (and it's a trivial implementation).
Minor comments: just naming and supporting both overloads.
Test results for "MCP"2588 passed, 116 skipped Merge workflow run. |
Test results for "tests 1"2 flaky40357 passed, 789 skipped Merge workflow run. |
docs/src/api/params.md
Outdated
| * since: v1.57.0 | ||
| - `update` <["raw"]|["relaxed"]> | ||
|
|
||
| Controls how the snapshot is updated. |
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.
Follow the style of similar options like updateSnapshots
I think something like this (feel free to give your opinion on the language):
Defines how the snapshot is updated when used with [`method: TestConfig.updateSnapshots`]. Defaults to `'relaxed'`.
* `'relaxed'` - Saves the accessibility snapshot with a relaxed matching structure (for example regular expressions to match number combinations).
* `'raw'` - Saves the unmodified accessibility snapshot. This snapshot is an exact match and will not match content with changed values.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.
updated docs in last commit, very similar to your suggestion
…apshot, update tests
Add exact parameter to toMatchAriaSnapshot to save raw data
Fixes #38074, references #38074.