Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,44 @@ sentryTest('click is ignored on div', async ({ getLocalTestUrl, page }) => {
},
]);
});

sentryTest('click is ignored on input file by default', async ({ getLocalTestUrl, page }) => {
if (shouldSkipReplayTest()) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });

await Promise.all([waitForReplayRequest(page, 0), page.goto(url)]);

const [req1] = await Promise.all([
waitForReplayRequest(page, (event, res) => {
const { breadcrumbs } = getCustomRecordingEvents(res);

return breadcrumbs.some(breadcrumb => breadcrumb.category === 'ui.click');
}),
page.locator('#inputFile').click(),
]);

const { breadcrumbs } = getCustomRecordingEvents(req1);

expect(breadcrumbs).toEqual([
{
category: 'ui.click',
data: {
node: {
attributes: {
id: 'inputFile',
},
id: expect.any(Number),
tagName: 'input',
textContent: '',
},
nodeId: expect.any(Number),
},
message: 'body > input#inputFile[type="file"]',
timestamp: expect.any(Number),
type: 'default',
},
]);
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down Expand Up @@ -27,6 +27,7 @@
<input type="button" id="inputButton" value="Input button" />
<input type="submit" id="inputSubmit" value="Input submit" />
<input type="text" id="inputText" />
<input type="file" id="inputFile" />

<h1 id="h1">Heading</h1>

Expand Down
Loading