forked from buefy/buefy
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updates the unit tests (spec) of `Table` so that they work with Vue 3 and `@vue/test-utils` V2: - Removes `setVueInstance` because it does nothing on `buefy-next`. - Replaces `sinon`'s `useFakeTimers` with a combination of `jest.useFakeTimers` and `jest.advanceTimersByTime` so that we will be able to remove `sinon` from dependencies in the future. Awaits `$nextTick` after `jest.advanceTimersByTime` to make sure DOM is updated, otherwise the test fails. - Replaces `wrapper.find` with `wrapper.findComponent` to locate a component, because `wrapper.find` is dedicated to finding a DOM element on `@vue/test-utils` V2. - Replaces `isEmpty` of `Wrapper` with a combination of `element` and `toBeEmptyDOMElement`, because `Wrapper` no longer provides `isEmpty` on `@vue/test-utils` V2. - Replaces `contains` of `Wrapper` with a combination of `find` and `exists`, because `Wrapper` no longer provides `contains` 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. - Awaits `wrapper.setProps` to make sure the subsequent tests verify the updated state. - Replaces `propsData` with `props`, because `propsData` might be deprecated in the future. - Refreshes the snapshot. I temporarily fixed the bug I found while updating the spec (#8) to make the snapshot. - NOTE: the tests won't pass until the bug is fixed: - #8 issue #1
- Loading branch information
Showing
2 changed files
with
65 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters