はじめに
Jest ^25.5.4を利用してMocalが表示されることをテストしてみました。
const modal = wrapper.find('modal-stub')
expect(modal.isVisible()).toBe(true)
その際、テストは通るものの、以下のような警告がコンソールに表示されました。
どうやら、将来的にisVisible()は削除されるとのことです。
[vue-test-utils]: isVisible is deprecated and will be removed in the next major version. Consider a custom matcher such as those provided in jest-dom: https://github.com/testing-library/jest-dom#tobevisible. When using with findComponent, access the DOM element with findComponent(Comp).element.
対応
今回は以下のように回避しましたが、別途、jest-domというライブラリを使用するという方法もあるようです。
こちらにQiitaでも記事を書いてくださっている方がいらっしゃいるようです。
const modal = wrapper.find('modal-stub')
expect(modal.exists()).toBe(true)
追記
コメントで頂いたように、isVisible()は存在チェックに利用するのは正しい使い方ではないです。
それを理解したうえで使うのもありかもしれませんが、やはりjest-domを利用するのがよさそうです。。