svelte-materialify icon indicating copy to clipboard operation
svelte-materialify copied to clipboard

Problem testing Menu component using cypress

Open cendro93 opened this issue 4 years ago • 1 comments

I have Menu component

<script>
  import { Menu } from "svelte-materialify";
</script>

<Menu>
  <div slot="activator" />
</Menu>

And then Menu.unit-spec.js to test this component

import Menu from './Menu.svelte';
import {mount} from 'cypress-svelte-unit-test'

it('Test menu component', () => {
    mount(Menu)
})

When i run this test i get an error, the error does not appear when using other component from svelte-materialify: image

cendro93 avatar Dec 17 '20 11:12 cendro93

The Menu component is a problem due to not having a good way to create svelte portals so we hijack the querySelector, searching for a solution.

TheComputerM avatar Dec 17 '20 12:12 TheComputerM