How to write tests for vue menu component using Jest

I find that it’s much harder to write tests for things that already exist, because that thing hasn’t been made to be easy to test.

If I were in your situation, I would remove all of the menu behaviour completely and start again, using the previous code as a template for future work.

I would ask myself, what behaviour that doesn’t yet exist without the menu do I want to occur. Write a test for that behaviour. Then add a piece of the that menu feature that does that behaviour.