Skip to content

Failed setting prop "attributes" on stub #1995

Closed as not planned
Closed as not planned
@ol1s

Description

@ol1s

Defining a prop named attributes on a stubbed component throws a warning.

Failed setting prop "attributes" on <child-component-stub>: value test123 is invalid:

https://stackblitz.com/edit/vitest-dev-vitest-wqbs9d?file=test/basic.test.ts

import { defineComponent } from 'vue';
import { mount } from '@vue/test-utils';

const ChildComponent = defineComponent({
  props: {
    attributes: {
      type: String,
      default: null,
    },
  },
});

const ParentComponent = defineComponent({
  components: { ChildComponent },
  template: `<ChildComponent attributes="test123" />`,
});

test('it stubs component', () => {
  const wrapper = mount(ParentComponent, { shallow: true });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions