Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(replay): Add additional properties for UI clicks#7395
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
8b971418a726a08f7d5beba522318aa9ee1793e41f75255135ed611834366418bfeb832f7e73ee616727f836c0beb890708e385161269102File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Note that these are the serialized attributes and not attributes directly on | ||
| // the DOM Node. Attributes we are interested in: | ||
| const ATTRIBUTES_TO_RECORD = new Set([ | ||
| 'id', | ||
| 'class', | ||
| 'aria-label', | ||
| 'role', | ||
| 'name', | ||
| 'alt', | ||
| 'title', | ||
| 'data-test-id', | ||
| 'data-testid', | ||
| ]); | ||
| /** | ||
| * Inclusion list of attributes that we want to record from the DOM element | ||
| */ | ||
| export function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown> { | ||
| const obj: Record<string, unknown> = {}; | ||
| for (const key in attributes) { | ||
| if (ATTRIBUTES_TO_RECORD.has(key)) { | ||
| let normalizedKey = key; | ||
| if (key === 'data-testid' || key === 'data-test-id') { | ||
| normalizedKey = 'testId'; | ||
| } | ||
Comment on lines
+24
to
+26
MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ryan953 let's capture both and normal to | ||
| obj[normalizedKey] = attributes[key]; | ||
| } | ||
| } | ||
| return obj; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
imported a type and enum