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
find is deprecated, findComponent fails #1643
Comments
Hi! More on that: https://vue-test-utils.vuejs.org/upgrading-to-v1/#find Hope it helps! |
Sorry, my description probably was confusing. I am searching for component, but getting that error regardless: This is a basic test: describe('Mounting component', () => {
test('without wrapper', () => {
const wrapper = mount(IconifyIcon, {});
const item = wrapper.find(IconifyIcon);
expect(item.exists()).toBe(true);
expect(item.html()).toStrictEqual(
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"></svg>'
);
});
}); Function Component is here: https://github.com/iconify/iconify/blob/master/packages/vue/src/IconifyIcon.ts |
It is a functional component with |
I believe this was fixed by #1593. A new version of VTU just hasn't been released since that PR was merged. |
Yeah, that sounds about right! We'll issue a release in the upcoming days, I'll let you know! |
Thank you! Looking forward to it.
…On Sat, 15 Aug 2020, 11:12 Adrià Fontcuberta, ***@***.***> wrote:
Yeah, that sounds about right! We'll issue a release in the upcoming days,
I'll let you know!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1643 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGIYD3ODC4DKYMTSD4YSCDSAY7PFANCNFSM4P7KG66A>
.
|
VTU new version about 2 days ago I am not sure if this is fixed there, let me know. |
Yes, that fixed it. Thank you! |
Subject of the issue
Function
find()
was deprecated, but there is no viable alternative.Steps to reproduce
Replaced
find()
withfindComponent()
as per deprecation notice.Expected behaviour
Renaming function should not change its behavior, tests should continue to run.
Actual behaviour
Tests started to fail with this error:
You cannot chain findComponent off a DOM element. It can only be used on Vue Components.
How to continue testing DOM elements created by Vue component after
find()
is gone?The text was updated successfully, but these errors were encountered: