Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Sep 28, 2024
1 parent 34a4a7a commit 4e07428
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test('Collecting signals whenever a user enters text input', async ({
)
const interactionSignals = indexPage.signalsAPI.getEvents('interaction')

const data = expect.objectContaining({
const data = {
eventType: 'change',
target: expect.objectContaining({
attributes: expect.objectContaining({
Expand All @@ -47,13 +47,6 @@ test('Collecting signals whenever a user enters text input', async ({
tagName: 'INPUT',
value: 'John Doe',
}),
})
expect(interactionSignals[0]).toMatchObject({
event: 'Segment Signal Generated',
type: 'track',
properties: {
type: 'interaction',
data,
},
})
}
expect(interactionSignals[0].properties!.data).toMatchObject(data)
})
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,15 @@ test('redaction enabled -> will XXX the value of text input', async ({
)
const interactionSignals = indexPage.signalsAPI.getEvents('interaction')

const data = expect.objectContaining({
const data = {
eventType: 'change',
target: expect.objectContaining({
name: 'name',
type: 'text',
value: 'XXX', // redacted
}),
})
expect(interactionSignals[0]).toMatchObject({
event: 'Segment Signal Generated',
type: 'track',
properties: {
type: 'interaction',
data,
},
})
}
expect(interactionSignals[0].properties!.data).toMatchObject(data)
})

test('redation disabled -> will not touch the value of text input', async ({
Expand All @@ -60,19 +53,11 @@ test('redation disabled -> will not touch the value of text input', async ({
)
const interactionSignals = indexPage.signalsAPI.getEvents('interaction')

const data = expect.objectContaining({
const data = {
eventType: 'change',
target: expect.objectContaining({
value: 'John Doe', // noe redacted
}),
})

expect(interactionSignals[0]).toMatchObject({
event: 'Segment Signal Generated',
type: 'track',
properties: {
type: 'interaction',
data,
},
})
}
expect(interactionSignals[0].properties!.data).toMatchObject(data)
})

0 comments on commit 4e07428

Please sign in to comment.