Skip to content

Commit

Permalink
back to original elements parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tiina303 committed Nov 20, 2023
1 parent bbd346b commit da29ebf
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions plugin-server/functional_tests/exports-v1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,11 @@ test.concurrent(`exports: exporting $autocapture events on ingestion`, async ()
plugin_type: 'source',
is_global: false,
source__index_ts: `
export const composeWebhook(event, { global, config }) => {
return {
url: \`http://localhost:${server.address()?.port}/${teamId}\`,
method: "POST",
body: JSON.stringify(event),
}
export const onEvent = async (event, { global, config }) => {
await fetch(
"http://localhost:${server.address()?.port}/${teamId}",
{method: "POST", body: JSON.stringify(events)}
)
}
`,
})
Expand All @@ -121,7 +120,7 @@ test.concurrent(`exports: exporting $autocapture events on ingestion`, async ()
properties: {
name: 'hehe',
uuid: new UUIDT().toString(),
$elements_chain: 'elements_chain',
$elements: [{ tag_name: 'div', nth_child: 1, nth_of_type: 2, $el_text: '💻' }],
},
})

Expand All @@ -137,10 +136,20 @@ test.concurrent(`exports: exporting $autocapture events on ingestion`, async ()
properties: expect.objectContaining({
name: 'hehe',
uuid: uuid,
$elements_chain: 'elements_chain',
}),
timestamp: expect.any(String),
uuid: uuid,
elements: [
{
tag_name: 'div',
nth_child: 1,
nth_of_type: 2,
order: 0,
$el_text: '💻',
text: '💻',
attributes: {},
},
],
}),
])
},
Expand Down

0 comments on commit da29ebf

Please sign in to comment.