diff --git a/docs/api/index.md b/docs/api/index.md index 1314ccf1f..701a05755 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1056,12 +1056,13 @@ findAll(selector: string): DOMWrapper[] ```js import { mount } from '@vue/test-utils' -import Component from './Component.vue' +import BaseTable from './BaseTable.vue' test('findAll', () => { - const wrapper = mount(Component) + const wrapper = mount(BaseTable); - wrapper.findAll('[data-test="number"]') //=> found; returns array of DOMWrapper + // .findAll() returns an array of DOMWrappers + const thirdRow = wrapper.findAll('tr')[2]; }) ``` diff --git a/docs/migration/index.md b/docs/migration/index.md index 892c47440..ee8c51557 100644 --- a/docs/migration/index.md +++ b/docs/migration/index.md @@ -216,3 +216,19 @@ Vue 3 renamed the `vm.$destroy` to `vm.$unmount`. Vue Test Utils has followed su ### `scopedSlots` is now merged with `slots` Vue 3 united the `slot` and `scoped-slot` syntax under a single syntax, `v-slot`, which you can read about in the [the docs](https://v3.vuejs.org/guide/migration/slots-unification.html#overview). Since `slot` and `scoped-slot` are now merged, the `scopedSlots` mounting option is now deprecated - just use the `slots` mounting option for everything. + +### `findAll().at()` removed + +`findAll()` now returns an array of DOMWrappers. + +**Before:** + +```js +wrapper.findAll('[data-test="token"]').at(0); +``` + +**After:** + +```js +wrapper.findAll('[data-test="token"]')[0]; +```