Skip to content

Commit eb8b552

Browse files
committed
chore: add test ID to dummy input
1 parent 035e678 commit eb8b552

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

site/src/hooks/useClipboard.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ function simulateClipboardWrite(textToCopy: string): boolean {
8080
const previousFocusTarget = document.activeElement;
8181
const dummyInput = document.createElement("input");
8282

83+
// Have to add test ID to dummy element for mocking purposes in tests
84+
dummyInput.setAttribute("data-testid", "dummy");
85+
8386
// Using visually-hidden styling to ensure that inserting the element doesn't
8487
// cause any content reflows on the page (removes any risk of UI flickers).
8588
// Can't use visibility:hidden or display:none, because then the elements

0 commit comments

Comments
 (0)