Skip to content

Commit a0e76b6

Browse files
fix: fix order of errors
1 parent 176d853 commit a0e76b6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/test-utils/src/wrapper.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,15 @@ export default class Wrapper implements BaseWrapper {
237237
*/
238238
findComponent(rawSelector: Selector): Wrapper | ErrorWrapper {
239239
const selector = getSelector(rawSelector, 'findComponent')
240-
if (selector.type === DOM_SELECTOR) {
240+
if (!this.vm) {
241241
throwError(
242-
'findComponent requires a Vue constructor or valid find object. If you are searching for DOM nodes, use `find` instead'
242+
'You cannot chain findComponent off a DOM element. It can only be used on Vue Components.'
243243
)
244244
}
245-
if (!this.vm) {
245+
246+
if (selector.type === DOM_SELECTOR) {
246247
throwError(
247-
'You cannot chain findComponent off a DOM element. It can only be used on Vue Components.'
248+
'findComponent requires a Vue constructor or valid find object. If you are searching for DOM nodes, use `find` instead'
248249
)
249250
}
250251

0 commit comments

Comments
 (0)