1 month ago

Class SeeInOrder not found when testing component / blade

Posted 1 month ago by TollerHovler

Hello! I'm trying to write tests for a few components but I stumbled upon an issue.

I'm attempting to use the SeeInOrder assertion on a component. I have tried a few approaches:

  public function testComponent() {
        $this->component(Button::class, [])->assertSeeInOrder([]);
  public function testComponent() {
        $this->blade("<x-button />")->assertSeeInOrder([]);

However, both these approaches give me this error:

Error : Class 'Illuminate\Testing\SeeInOrder' not found

It's only the "inOrder" assertions that are throwing this issue. If I use "assertSee" or "assertSeeText" it works fine. The "inOrder" variants work fine in other parts of the test suite. The weird thing is that PHPStorm suggests both "InOrder" variants on both the component and the blade solution (this is one of the reasons I believe these assertions are meant to work at least).

Anyone who can tell me why this is?

Many thanks!

Please sign in or create an account to participate in this conversation.