forked from buefy/buefy
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BNavbar crashed with "TypeError: this.$slots.brand is not a function" #28
Labels
bug
Something isn't working
Comments
kikuomax
added a commit
to kikuomax/buefy
that referenced
this issue
Aug 14, 2023
- Fixes the bug where an empty `BNavbar` crashed with "TypeError: this.$slots.brand is not a function". Checks if `this.$slots.brand` is not nullish before calling it. issue ntohq#28
kikuomax
added a commit
that referenced
this issue
Aug 14, 2023
- Updates the unit tests (spec) of `Navbar` so that they can work with `@vue/test-utils` V2 and breaking changes: - Corrects v-model bindings: - property: `active` → `modelValue` - event: `update:active` → `update:modelValue` - Replaces `wrapper.contains` with a combination of `find` and `exists` because `wrapper.contains` no longer exists in `@vue/test-utils` V2. - Awaits `wrapper.setProps` and `wrapper.trigger` to make sure the subsequent tests verify the updated state. - Replaces the test on `wrapper.isVueInstance()` with presence of `wrapper.vm` because `wrapper.isVueInstance` no longer exists in `@vue/test-utils` V2. - Replaces `propsData` for `mount` with `props` because `propsData` might be deprecated in the future. - Refreshes the snapshot. I did not find any problems in the updated snapshot. However, the snpshot won't match until we fix the issue #29. - The tests won't pass until we fix the issue #28. issue #1
kikuomax
added a commit
to kikuomax/buefy
that referenced
this issue
Sep 4, 2023
- Updates the unit tests (spec) of `Navbar` so that they can work with `@vue/test-utils` V2 and breaking changes: - Corrects v-model bindings: - property: `active` → `modelValue` - event: `update:active` → `update:modelValue` - Replaces `wrapper.contains` with a combination of `find` and `exists` because `wrapper.contains` no longer exists in `@vue/test-utils` V2. - Awaits `wrapper.setProps` and `wrapper.trigger` to make sure the subsequent tests verify the updated state. - Replaces the test on `wrapper.isVueInstance()` with presence of `wrapper.vm` because `wrapper.isVueInstance` no longer exists in `@vue/test-utils` V2. - Replaces `propsData` for `mount` with `props` because `propsData` might be deprecated in the future. - Refreshes the snapshot. I did not find any problems in the updated snapshot. However, the snpshot won't match until we fix the issue ntohq#29. - The tests won't pass until we fix the issue ntohq#28. issue ntohq#1
wesdevpro
pushed a commit
that referenced
this issue
Sep 16, 2023
* test(lib): update Navbar spec - Updates the unit tests (spec) of `Navbar` so that they can work with `@vue/test-utils` V2 and breaking changes: - Corrects v-model bindings: - property: `active` → `modelValue` - event: `update:active` → `update:modelValue` - Replaces `wrapper.contains` with a combination of `find` and `exists` because `wrapper.contains` no longer exists in `@vue/test-utils` V2. - Awaits `wrapper.setProps` and `wrapper.trigger` to make sure the subsequent tests verify the updated state. - Replaces the test on `wrapper.isVueInstance()` with presence of `wrapper.vm` because `wrapper.isVueInstance` no longer exists in `@vue/test-utils` V2. - Replaces `propsData` for `mount` with `props` because `propsData` might be deprecated in the future. - Refreshes the snapshot. I did not find any problems in the updated snapshot. However, the snpshot won't match until we fix the issue #29. - The tests won't pass until we fix the issue #28. issue #1 * test(lib): update NavbarBurger spec - Updates the unit tests (spec) of `NavbarBurger` so that they can work with `@vue/test-utils` V2: - Specifies the element tag to the selector given to `wrapper.find` instead of testing the tag with `is`. Because `is` no longer exists in `@vue/test-utils` V2. - Awaits `wrapper.setProps` to make sure the subsequent assertions verify the updated state. - Replaces the test on `wrapper.isVueInstance()` with presence of `wrapper.vm` because `wrapper.isVueInstance` no longer exists in `@vue/test-utils` V2. - Refreshes the snapshot. I did not find any problems in the updated snapshot. However, the snapshot won't match until we fix the issue #29. issue #1 * test(lib): update NavbarItem spec - Updates the unit tests (spec) of `NavbarItem` so that they can work with `@vue/test-utils` V2 and Vue 3: - Replaces `listeners` option for `shallowMount` with `on{event}` props, because `listeners` no longer works on `@vue/test-utils` V2 but `on{event}` prop does the equivalent job on Vue 3 instead. - Mounts `stubBNavBar` and inserts `BNavbarItem` into its default slot instead of specifying `stubBNavBar` as `parentComponents`, because `parentComponents` no longer works on `@vue/test-utils` V2. - Replaces `wrapper.contains` with a combination of `find` and `exists` because `wrapper.contains` no longer exists in `@vue/test-utils` V2. - A test on a tag name is merged with a selector given to `find`. - Awaits `wrapper.setProps` to make sure the subsequent assertions verify the updated state. - 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. - Fixes the event type for "click": `KeyboardEvent` → `MouseEvent`. - Replaces `sinon.stub` with `jest.fn`. No longer imports `sinon`. issue #1 * test(lib): update NavbarDropdown spec - Updates the unit tests (spec) of `NavbarDropdown` so that they can work with `@vue/test-utils` V2: - Awaits `wrapper.setProps` to make sure the subsequent assertions verify the updated state. - 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 loger exists in `@vue/test-utils` V2. - Refreshes the snapshot. I found the updated snapshot had two `div` elements with `navbar-dropdown` class, but this is fine because they were introduced after the old snapshot was recorded. issue #1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview of the problem
Buefy version: buefy-next (67ecf3a)
Vuejs version: 3.3.4
OS/Browser: macOS/
@vue/test-utils
, SafariDescription
An empty
<b-navbar>
crashed with the following error:Steps to reproduce
I encountered this while working on unit tests of
Navbar
:Expected behavior
No error is thrown.
Actual behavior
It threw an error.
The text was updated successfully, but these errors were encountered: