You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Continuing from the discussion (#18076), components like VMain, VNavigationDrawer, VBottomNavigation, VAppBar, and VLayoutItem do not render in tests using @vue/test-utils, making it impossible to test components that contain these components.
We encountered the same issue in component testing a component with v-app-bar with Playwright, none of the fixes suggested above or in the discussion (#18076) seemed to work. As a workaround we've created a template with v-app and a nested dynamic component that can be passed in as a prop. Posting in case it helps anyone else out.
import{test,expect}from'@playwright/experimental-ct-vue'importAppBarfrom'../../src/components/AppBar.vue'importComponentTestAppTemplatefrom'./templates/ComponentTestAppTemplate.vue'test('app bar title is correct',async({ mount })=>{constappBar=awaitmount(ComponentTestAppTemplate,{props: {componentToTest: AppBar}})awaitexpect(appBar).toContainText('App Bar Title')})
Where AppBar.vue is:
<template><v-app-bar><template#prepend></template><v-app-bar-title>
App Bar Title
</v-app-bar-title><template#append></template></v-app-bar></template><scriptlang="ts" setup></script>
Environment
Vuetify Version: 3.6.7
Vue Version: 3.4.27
Browsers: Chrome 125.0.0.0
OS: Windows 10
Steps to reproduce
Continuing from the discussion (#18076), components like VMain, VNavigationDrawer, VBottomNavigation, VAppBar, and VLayoutItem do not render in tests using @vue/test-utils, making it impossible to test components that contain these components.
For example, the following test:
Will have the following markup:
The following variant also does not work:
Expected Behavior
Components must rendering
Actual Behavior
Components are not rendering
Reproduction Link
https://play.vuetifyjs.com/#...
Other comments
Can’t give a link to the repository, since the work is being done in a private repository
The text was updated successfully, but these errors were encountered: