Skip to content

.props() don't receive data in when child component is extended and stubbed #746

Closed
@Loremaster

Description

@Loremaster

Version

1.0.0-beta.19

Reproduction link

https://github.com/Loremaster/vue-test-utils-issues

Steps to reproduce

  1. Download source code of the example
  2. Install packages $ yarn
  3. Run tests $ yarn test:unit

What is expected?

All tests should pass

What is actually happening?

Test is failing and child component doesn't receive prop (as it does when it's a non typescript component):

  ● List.vue › ListItem receives text as a prop

    expect(received).toEqual(expected)

    Expected value to equal:
      "Learn Vue"
    Received:
      undefined

    Difference:

      Comparing two different types of values. Expected string but received undefined.

      15 |     const wrapper = shallowMount(List);
      16 |     const listItem = wrapper.find(ListItem);
    > 17 |     expect(listItem.props().text).toEqual("Learn Vue");
         |                                   ^
      18 |   });
      19 | });

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions