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.
* test(lib): update Table spec - 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 * test(lib): update TableColumn spec - 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 * test(lib): update TableMobileSort spec - Updates the unit tests (spec) of `TableMobileSort` so that they can work with `@vue/test-utils` V2: - Awaits `wrapper.setProps` to make sure the subsequent tests verify the updated state. Also replaces an old style async test case with async/await syntax. - 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 `sync` option for `shallowMount` because it no longer exists in `@vue/test-utils` V2 and has no effect. The tests won't pass until the issue mentioned in the following comment is fixed: - #1 (comment) issue #1 * fix(lib): TableMobileSort without columns - Fixes the issue where `TableMobileSort` crashed at initialization if `columns` was `null` or `undefined`. This happened in unit tests. I do not think users of Buefy face this issue. issue #1 (comment)
- Loading branch information
Showing
6 changed files
with
87 additions
and
87 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
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
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