vue-emoji-picker icon indicating copy to clipboard operation
vue-emoji-picker copied to clipboard

Jest tests

Open szydloit opened this issue 2 years ago • 1 comments

While running a test:

import { shallowMount } from /'@vue/test-utils/';
import EmojiPicker from /'../EmojiPicker.vue/';

describe(/'EmojiPicker.vue/', () => {

  it(/'renders a vue instance/', () => {
    expect(
      shallowMount(EmojiPicker, {
      })
    ).toBeTruthy();
  });
});

there's an error:

[Vue warn]: Error in render: \"TypeError: Cannot read properties of undefined (reading \'click\')\" found in ---> <VueEmojiPicker> <Anonymous> <Root>

it is caused by this line:

slot-scope="{ events: { click: clickEvent } }"

any suggestions how to mock up this?

szydloit avatar Apr 13 '23 13:04 szydloit

Hey, I haven't used Vue for a few years at this point, so I am not sure what could be causing this. What I would suggest is you to view the source of this component and rewrite it so it can suit your needs :)

DCzajkowski avatar Apr 15 '23 15:04 DCzajkowski