-
Notifications
You must be signed in to change notification settings - Fork 272
Closed
Description
Subject of the issue
findAll()
returns nothing when the component is using a render function.
Steps to reproduce
This as TestComponent.vue
:
<template>
<render></render>
</template>
<script setup lang="ts">
import { h } from 'vue';
const render = () => [
h('a', {}, 'first'),
h('a', {}, 'second'),
h('a', {}, 'third'),
];
</script>
Then in TestComponent.spec.ts
:
import { mount } from '@vue/test-utils';
import TestComponent from './TestComponent.vue';
describe('mcve', () => {
test('should have all three anchors', () => {
const wrapper = mount(TestComponent);
expect(wrapper.findAll('a').length).toBe(3);
});
});
Expected behaviour
The test should pass.
Actual behaviour
The test fails because findAll
is unable to find the three anchors.
Archetipo95
Metadata
Metadata
Assignees
Labels
No labels