Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d177b9

Browse files
committed
Update test for clipboard-copied event name
1 parent f30e32c commit 9d177b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/clipboard-copy-element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function copyTarget(content: Element) {
2626
return copyInput(content)
2727
}
2828
} else if (content instanceof HTMLAnchorElement && content.hasAttribute('href')) {
29-
copyText(button, content.href)
29+
return copyText(content.href)
3030
} else {
3131
return copyNode(content)
3232
}

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('clipboard-copy element', function() {
6565
})
6666

6767
whenCopied = new Promise(resolve => {
68-
document.addEventListener('copy', () => resolve(copiedText), {once: true})
68+
document.addEventListener('clipboard-copied', () => resolve(copiedText), {once: true})
6969
})
7070
})
7171

0 commit comments

Comments
 (0)