Skip to content

Commit

Permalink
test(lib): update TableColumn spec
Browse files Browse the repository at this point in the history
- Updates the unit tests (spec) of `TableColumn` so that they can work
  with `@vue/test-utils` V2:
    - Replaces `find` with `findComponent` because `find` is dedicated
      to DOM elements on `@vue/test-utils` V2.
    - Replaces `wrapper.name()` with `wrapper.vm.$options.name` because
      `wrapper.name` no longer exists in `@vue/test-utils` V2.
    - Replaces the test on `wrapper.isVueInstance` with presence of
      `wrapper.vm` because `wrapper.isVueInstance` no longer exists in
      `@vue/test-utils` V2.
    - Removes the `sync` option for `mount` because it no longer exists
      in `@vue/test-utils`. It neither has any effect.

issue #1
  • Loading branch information
kikuomax committed Jul 26, 2023
1 parent c2b2a29 commit 2554651
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/table/TableColumn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const WrapperComp = {

describe('BTableColumn', () => {
beforeEach(() => {
wrapper = mount(WrapperComp, { sync: false }).find({ ref: 'testItem' })
wrapper = mount(WrapperComp).findComponent({ ref: 'testItem' })
})

it('is called', () => {
expect(wrapper.name()).toBe('BTableColumn')
expect(wrapper.isVueInstance()).toBeTruthy()
expect(wrapper.vm).toBeTruthy()
expect(wrapper.vm.$options.name).toBe('BTableColumn')
})
})

0 comments on commit 2554651

Please sign in to comment.