I'm trying to test, with Jest's snapshots, a component containing a menu. The problem is that the menu's content is not rendered so I can't test the whole component.
Is there a way to force a menu to render all its MenuOption? I tried to use <Menu opened={true}>...</Menu>
but the result was the same.
For example, this code will produce a snapshot not containing foo
.
expect(renderer.create(
<MenuContext>
<Menu>
<MenuOptions>
<MenuOption>
foo
</MenuOption>
</MenuOptions>
</Menu>
</MenuContext>
)).toMatchSnapshot();