aboutsummaryrefslogtreecommitdiff
path: root/src/components/emoji_input/emoji_input.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-10-10 22:04:49 +0300
committerHenry Jameson <me@hjkos.com>2022-10-10 22:04:49 +0300
commit4a1ffced44c41be5c4ba60c5b8678b200c328a40 (patch)
tree08f646e7d6cd54cd80009edd84368f9dfaf9ce15 /src/components/emoji_input/emoji_input.js
parentfaca1b31e3dce91488e10133aa0afe85f358a238 (diff)
fix unit tests
Diffstat (limited to 'src/components/emoji_input/emoji_input.js')
-rw-r--r--src/components/emoji_input/emoji_input.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js
index 144b7c72..3d3c58ac 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -211,8 +211,12 @@ const EmojiInput = {
if (!input) return
this.input = input
this.caretEl = hiddenOverlayCaret
- suggestorPopover.setAnchorEl(this.caretEl)
- this.$refs.picker.setAnchorEl(this.caretEl)
+ if (suggestorPopover.setAnchorEl) {
+ suggestorPopover.setAnchorEl(this.caretEl) // unit test compat
+ this.$refs.picker.setAnchorEl(this.caretEl)
+ } else {
+ console.warn('setAnchorEl not found, are we in a unit test?')
+ }
const style = getComputedStyle(this.input)
this.overlayStyle.padding = style.padding
this.overlayStyle.border = style.border