Skip to content

Commit 422d1b4

Browse files
committed
[PANA-6072] fix e2e test + lint
1 parent 67b062e commit 422d1b4

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

packages/rum-core/src/domain/action/trackClickActions.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,14 @@ function computeClickActionBase(
246246
const rect = target.getBoundingClientRect()
247247
const selector = getSelectorFromElement(target, configuration.actionNameAttribute)
248248

249-
const composedPathSelector = isExperimentalFeatureEnabled(ExperimentalFeature.COMPOSED_PATH_SELECTOR) && typeof event.composedPath === 'function'
250-
? getComposedPathSelector(event.composedPath(), configuration.actionNameAttribute, configuration.allowedHtmlAttributes || [])
251-
: undefined
249+
const composedPathSelector =
250+
isExperimentalFeatureEnabled(ExperimentalFeature.COMPOSED_PATH_SELECTOR) && typeof event.composedPath === 'function'
251+
? getComposedPathSelector(
252+
event.composedPath(),
253+
configuration.actionNameAttribute,
254+
configuration.allowedHtmlAttributes || []
255+
)
256+
: undefined
252257

253258
if (selector) {
254259
updateInteractionSelector(event.timeStamp, selector)

test/e2e/scenario/rum/actions.scenario.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,10 +786,8 @@ test.describe('action collection with composed path selector', () => {
786786
createTest('should not return a composed_path_selector if flag is disabled')
787787
.withRum({ trackUserInteractions: true })
788788
.withBody(html`
789-
<div id="container">
790789
<button>Click</button>
791790
<button id="my-button" data-test-allowed="test-btn" data-random="secret" class="foo bar baz">Click me</button>
792-
</div>
793791
`)
794792
.run(async ({ intakeRegistry, flushEvents, page }) => {
795793
const button = page.locator('#my-button')
@@ -807,10 +805,8 @@ test.describe('action collection with composed path selector', () => {
807805
allowedHtmlAttributes: ['data-test-allowed'],
808806
})
809807
.withBody(html`
810-
<div id="container">
811808
<button>Click</button>
812809
<button id="my-button" data-test-allowed="test-btn" data-random="secret" class="foo bar baz">Click me</button>
813-
</div>
814810
`)
815811
.run(async ({ intakeRegistry, flushEvents, page }) => {
816812
const button = page.locator('#my-button')
@@ -820,7 +816,7 @@ test.describe('action collection with composed path selector', () => {
820816
const actionEvents = intakeRegistry.rumActionEvents
821817
expect(actionEvents).toHaveLength(1)
822818
expect(actionEvents[0]._dd.action?.target?.composed_path_selector).toBe(
823-
'BUTTON#my-button[data-test-allowed="test-btn"].bar.baz.foo:nth-child(2):nth-of-type(2);DIV#container;'
819+
'BUTTON#my-button[data-test-allowed="test-btn"].bar.baz.foo:nth-child(2):nth-of-type(2);'
824820
)
825821
})
826822
})

0 commit comments

Comments
 (0)