Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue 3 component in slot doesn't load #29215

Open
RoccoDevs opened this issue Mar 28, 2024 · 2 comments
Open

Vue 3 component in slot doesn't load #29215

RoccoDevs opened this issue Mar 28, 2024 · 2 comments
Labels
CT Issue related to component testing npm: @cypress/vue @cypress/vue package issues stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period

Comments

@RoccoDevs
Copy link

RoccoDevs commented Mar 28, 2024

Current behavior

I have a cypress component test, this test worked before my migration to vue 3. The test added a component through the slots mount option. After migrating to vue 3 that functionality no longer works. Is this expected behaviour? I have included a test project where I try to do the same. Simply open cypress and run the component test.

I have tried various ways of importing the component, like defining the components with names but none seem to work.

The slots get added through mount:

import HelloWorld from '../HelloWorld.vue'
import TheWelcome from '../TheWelcome.vue'

describe('HelloWorld', () => {
  it('playground', () => {
    cy.mount(HelloWorld, {
      props:
        {
          msg: 'Hello Cypress'
        } ,
      slots: {
        default: '<TheWelcome></TheWelcome>'
      }
    })
    cy.get('h1').should('contain', 'Sub component')
  })
})

Desired behavior

Cypress properly adds the vue 3 requirements to load in the component.

Test code to reproduce

https://github.com/RoccoDevs/vue-slots-cypress

Cypress Version

13.7.1

Node version

20.11.1

Operating System

Windows 11 23H2

Debug Logs

No response

Other

No response

@jennifer-shehane jennifer-shehane added CT Issue related to component testing npm: @cypress/vue @cypress/vue package issues stage: needs investigating Someone from Cypress needs to look at this labels Mar 28, 2024
@thevladisss
Copy link
Contributor

thevladisss commented Apr 17, 2024

You can definitely use "h" function from "vue" package that would let you render this component. I would assume this problem is caused by the absence of runtime template compiler that cannot render the component is slot

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CT Issue related to component testing npm: @cypress/vue @cypress/vue package issues stage: needs investigating Someone from Cypress needs to look at this stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

4 participants