Skip to content

Commit ac8ebfe

Browse files
committed
chore(compat): replace find with findComponents
- accessing vm on DOMWrapper is discouraged and unsupported in VTU v1
1 parent e7aaf2d commit ac8ebfe

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/components/button-toolbar/button-toolbar.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe('button-toolbar', () => {
105105
expect($groups).toBeDefined()
106106
expect($groups.length).toBe(3)
107107

108-
const $btns = wrapper.findAllComponents(BButton)
108+
const $btns = wrapper.findAll('button')
109109
expect($btns).toBeDefined()
110110
expect($btns.length).toBe(6)
111111
expect(

src/components/dropdown/dropdown-item.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('dropdown-item', () => {
134134
expect(wrapper.findAll('li').length).toBe(4)
135135
expect(wrapper.findAll('a').length).toBe(4)
136136

137-
const $links = wrapper.findAll('a')
137+
const $links = wrapper.findAllComponents('a')
138138

139139
expect($links.at(0).vm).toBeDefined()
140140
expect($links.at(0).vm.$options.name).toBe('BLink')

src/components/dropdown/dropdown.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ describe('dropdown', () => {
542542
expect(wrapper.findAll('.dropdown-menu .dropdown-item').length).toBe(1)
543543

544544
const $container = wrapper.find('#container')
545-
const $dropdown = wrapper.find('.dropdown')
545+
const $dropdown = wrapper.findComponent('.dropdown')
546546
const $toggle = wrapper.find('.dropdown-toggle')
547547
const $menu = wrapper.find('.dropdown-menu')
548548
const $item = wrapper.find('.dropdown-item')

src/components/form-input/form-input.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ describe('form-input', () => {
463463
attachTo: document.body
464464
})
465465

466-
const $input = wrapper.find('input')
466+
const $input = wrapper.findComponent('input')
467467
$input.element.value = 'TEST'
468468
await $input.trigger('input')
469469

@@ -491,7 +491,7 @@ describe('form-input', () => {
491491
attachTo: document.body
492492
})
493493

494-
const $input = wrapper.find('input')
494+
const $input = wrapper.findComponent('input')
495495

496496
// Input event needed to set initial value
497497
$input.element.value = 'TEST'
@@ -527,7 +527,7 @@ describe('form-input', () => {
527527
attachTo: document.body
528528
})
529529

530-
const $input = wrapper.find('input')
530+
const $input = wrapper.findComponent('input')
531531
expect($input.vm.localValue).toEqual('TEST')
532532
expect(wrapper.emitted('update')).toBeUndefined()
533533
expect(wrapper.emitted('input')).toBeUndefined()

src/components/link/link.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ describe('b-link', () => {
412412

413413
expect(wrapper.findAll('a').length).toBe(5)
414414

415-
const $links = wrapper.findAll('a')
415+
const $links = wrapper.findAllComponents('a')
416416

417417
expect($links.at(0).vm).toBeDefined()
418418
expect($links.at(0).vm.$options.name).toBe('BLink')

0 commit comments

Comments
 (0)