Skip to content

Testing Dialogs with Vitest and Teleported Wrapper not Working #17084

Discussion options

You must be logged in to vote

Ah sorry, that's my fault. I see the mistake now, 2nd parameter is not props itself. Attached completed working variant.

// widget-dialog.test.ts

import { installQuasarPlugin } from '@quasar/quasar-app-extension-testing-unit-vitest'
import { mount } from '@vue/test-utils'
import WidgetDialog from 'app/test/vitest/__tests__/demo/WidgetDialog.vue'
import { describe, expect, it } from 'vitest'
import { nextTick } from 'vue'

installQuasarPlugin()

describe('WidgetDialog', () => {
  it('mounts component', async () => {
    const wrapper = mount(WidgetDialog, {
      props: {
        modelValue: true
      }
    })
    await nextTick()
    const portalWrapper = wrapper.findComponent({ name: '…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@julianctni
Comment options

@IlliaVeremiev
Comment options

Answer selected by julianctni
@julianctni
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants