Skip to content

Fallback content for a slot not being rendering  #1943

Open
@SaConway

Description

@SaConway

Subject of the issue

I'm rendering a parent component with a child component. In the child component, I have a default slot with fallback content. When using the mount function, the outerHTML doesn't include the slot fallback content from the child component.

I'm using version 1.2.1

Steps to reproduce

Parent.vue

<template>
    <child />
</template>

Child.vue

<template>
  <button>
    <slot>Submit</slot>
  </button>
</template>

Parent.test.js

import { mount } from '@vue/test-utils'
import Parent from './Parent.vue'

describe('Parent', () => {
  const wrapper = mount(Parent)
})

Expected behavior

The wrapper.element.outerHTML should be:

<button>Submit</button>

Actual behavior

The wrapper.element.outerHTML is:

<button></button>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions