#PEST not working correctly with Vue + Inertia + Valet + Vite

15 messages · Page 1 of 1 (latest)

dark plank
#

Hey, I am currently trying to write my first Tests with Pest but for some reason this test fails

test('it can render the sign-in page', function ()  {
    $this
        ->get('/auth/sign-in')
        ->assertSee('Welcome back');
});

it spams the console with a huge minified html file and is saying that it doesn't contain "Welcome back" - it should though..

Did I misconfigure something? I am using Laravel + Vue + Inertia.js

valid drift
#

Does the HTML it returns actually contain "Welcome back" (have you checked it's coming back in the response in the test)?

dark plank
# valid drift Does the HTML it returns actually contain "Welcome back" (have you checked it's ...

im not sure, it returns something like this

&quot;app.feecord.test&quot;},&quot;payment.manage&quot;:{&quot;uri&quot;:&quot;payment\/manage&quot;,&quot;methods&quot;:[&quot;GET&quot;,&quot;HEAD&quot;],&quot;domain&quot;:&quot;community.feecord.test&quot;},&quot;payment.store&quot;:{&quot;uri&quot;:&quot;payment&quot;,&quot;methods&quot;:[&quot;POST&quot;],&quot;domain&quot;:&quot;community.feecord.test&quot;},&quot;payment.delete&quot;:{&quot;uri&quot;:&quot;payment&quot;,&quot;methods&quot;:[&quot;DELETE&quot;],&quot;domain&quot;:&quot;community.feecord.test&quot;},&quot;payment.redirect&quot;:{&quot;uri&quot;:&quot;payment\/redirect&quot;,&quot;methods&quot;:[&quot;GET&quot;,&quot;HEAD&quot;],&quot;domain&quot;:&quot;community.feecord.test&quot;},&quot;payment.callback&quot;:{&quot;uri&quot;:&quot;payment\/callback&quot;,&quot;methods&quot;:[&quot;GET&quot;,&quot;HEAD&quot;],&quot;domain&quot;:&quot;community.feecord.test&quot;},&quot;payment.authenticate&quot;:{&quot;uri&quot;:&quot;payment\/authenticate&quot;,&quot;methods&quot;:[&quot;GET&quot;,&quot;HEAD&quot;],&quot;domain&quot;:&quot;community.feecord.test&quot;},&quot;payment&quot;:{&quot;uri&quot;:&quot;payment\/{server}&quot;,&quot;methods&quot;:[&quot;GET&quot;,&quot;HEAD&quot;],&quot;domain&quot;:&quot;community.feecord.test&quot;}},&quot;location&quot;:&quot;https:\/\/app.feecord.test\/auth\/sign-in&quot;},&quot;flash&quot;:{&quot;message&quot;:null}},&quot;url&quot;:&quot;\/auth\/sign-in&quot;,&quot;version&quot;:&quot;&quot;}"></div>    </body>\n
  </html>\n
  ' contains "Welcome back".
#

looks weird to me

valid drift
#

Out of interest: are you using Inertia?

dark plank
#

wrote it into the title of this thread: Using Vue, Inertia, Valet and Vite

valid drift
#

That's why it's not working then

#

assertSee can only see things in the HTML response

dark plank
#

i assumed it must be something with it but couldnt find a way to fix it yet

valid drift
#

not what is rendered with JavaScript with Inertia

dark plank
#

ohh

#

that's why there is assertInertia

#

thanks!