Skip to content

Commit f42844d

Browse files
authored
[6.x] Fixed vueAttribute for older Vue 2.x projects (#970)
* Fixed vueAttribute for older Vue 2.X projects * Update MakesAssertionsTest.php
1 parent 38cd370 commit f42844d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Concerns/MakesAssertions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ public function vueAttribute($componentSelector, $key)
11031103
return $this->driver->executeScript(
11041104
"var el = document.querySelector('".$fullSelector."');".
11051105
"if (typeof el.__vue__ !== 'undefined')".
1106-
' return el.__vue.'.$key.';'.
1106+
' return el.__vue__.'.$key.';'.
11071107
'try {'.
11081108
' var attr = el.__vueParentComponent.ctx.'.$key.';'.
11091109
" if (typeof attr !== 'undefined')".

tests/MakesAssertionsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ public function test_assert_vue()
10201020
->with(
10211021
"var el = document.querySelector('body foo');".
10221022
"if (typeof el.__vue__ !== 'undefined')".
1023-
' return el.__vue.foo;'.
1023+
' return el.__vue__.foo;'.
10241024
'try {'.
10251025
' var attr = el.__vueParentComponent.ctx.foo;'.
10261026
" if (typeof attr !== 'undefined')".
@@ -1078,7 +1078,7 @@ public function test_assert_vue_is_not()
10781078
->with(
10791079
"var el = document.querySelector('body foo');".
10801080
"if (typeof el.__vue__ !== 'undefined')".
1081-
' return el.__vue.foo;'.
1081+
' return el.__vue__.foo;'.
10821082
'try {'.
10831083
' var attr = el.__vueParentComponent.ctx.foo;'.
10841084
" if (typeof attr !== 'undefined')".
@@ -1136,7 +1136,7 @@ public function test_assert_vue_contains_formats_vue_prop_query()
11361136
->with(
11371137
'var el = document.querySelector(\'body [dusk="vue-component"]\');'.
11381138
"if (typeof el.__vue__ !== 'undefined')".
1139-
' return el.__vue.name;'.
1139+
' return el.__vue__.name;'.
11401140
'try {'.
11411141
' var attr = el.__vueParentComponent.ctx.name;'.
11421142
" if (typeof attr !== 'undefined')".

0 commit comments

Comments
 (0)