svelte-materialify
svelte-materialify copied to clipboard
Problem testing Menu component using cypress
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:

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.