-
Notifications
You must be signed in to change notification settings - Fork 155
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: Emit externalLinkInteracted
events for buttons
#1367
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1367 +/- ##
=======================================
Coverage 93.47% 93.47%
=======================================
Files 623 623
Lines 16769 16777 +8
Branches 5550 5551 +1
=======================================
+ Hits 15674 15682 +8
Misses 1022 1022
Partials 73 73
☔ View full report in Codecov by Sentry. |
expect(FunnelMetrics.externalLinkInteracted).not.toHaveBeenCalled(); | ||
}); | ||
|
||
test('sends an externalLinkInteracted metric within a Funnel Context with iconName=external', () => { |
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.
Could we maybe add a test for when iconName="external"
but no href
is present?
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.
LGTM, just left a comment about an additional test, to cover the case when isAnchor
is false
:)
Description
We're already emitting the
externalLinkInteracted
in the Link component, when theexternal
prop is enabled:components/src/link/internal.tsx
Lines 72 to 109 in ea832bb
There are also instances where the Button component is used to build an external link. The Button component does not have an
external
prop, but it allows to set theiconName
andtarget
to replicate the behaviour.When these properties are set, we will now send the same
externalLinkInteracted
event as in the Link component.Related links, issue #, if available: n/a
How has this been tested?
Added unit test
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.