Can not select <router-view> component
See original GitHub issueI’m trying to test certain parts of my applications computed properties such as locale or form validation results which are contained on the component loaded into the <router-view>
component
You can see in the screenshot
my default route view loads up my welcome component, using VueSelector() how do I actually select this component to access the state/prop/ computed data.
If i do
const root = VueSelector() const rootVue = await root.getVue()
This selects the <QLayout>
component
If I do
const welcome = VueSelector(‘welcome’) const welcomeVue = await welcome.getVue()
I get a
node.vue undefined
I’ve tried passing all sorts of combinations into VueSelector like
VueSelector(‘q-layout welcome’) VueSelector(‘router-view’) VueSelector(‘q-layout router-view’) VueSelector(‘router-view welcome’)
None of which actually select the component served from the route. I can however select any component nested within welcome such as the Login component like
const login = VueSelector(‘login’) const loginVue = await login.getVue()
await t .expect(loginVue.computed.isAuthenticated).eql(false) .expect(loginVue.props.facebook).eql(true)
Any help is really appreciated because otherwise I can’t test alot of data on any components server from the router
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Yes. You can do it using a ClientFunction feature. I’ve created an example
is there a way to access vue computed properties with the default selectors?