Component Tunnel.Consumer callback args are undefined when using e2e testing


#1

Hi,

I’ve spent the majority of my day attempting to test that the state of my hamburger menu is expanded or not (something I know how to test with react, angular, vanilla js, even vue) and having a very hard time.

Currently I’m using the Tunnel API, and from what I can tell, the state is an empty object (not even getting initialDefault) when using page.setContent('<my-component/>')

When putting console.log statements in the Tunnel.Provider functions I see the state looks as expected.

When putting console.log statements in the render function of my component, specifically under the consumer callback function, ithe state is just not there.

Because state is not there, my component will not render at all, as my state contains important things which are loaded by default.

When loading the application using stencil build(or start) everything looks good.

For now I’m using Tunnel.injectProps which seems to do the job. I created an issue in gitlab as well.