We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi folks, i have some problems with testing. It seems that pest can not handle nested props as documented. Here my test.
Any ideas?
test('screenings without query sorting are sorted by last screening date desc', function () { $screeningDates = [ 'firstDates' => [ '2024-01-01 18:00:00', '2024-01-02 21:00:00', '2024-01-03 21:00:00', ], 'secondDates' => [ '2024-01-02 18:00:00', '2024-01-05 21:00:00', '2024-01-06 21:00:00', ], 'thirdDates' => [ '2024-01-01 21:00:00', '2024-01-02 21:00:00', '2024-01-06 21:00:00', ] ]; $screenings = []; foreach ($screeningDates as $var => $screeningDate) { $screenings[$var] = Screening::factory()->create([ 'title' => $var ]) ->each(function (Screening $screening) use ($screeningDate) { foreach ($screeningDate as $date) { $screening->dates()->save(ScreeningDate::factory()->make([ 'date_time' => Carbon::parse($date) ])); } }); } $this->withoutMiddleware(); $response = $this->get(route('admin.web.screening.index')); $response->assertInertia(fn(AssertableInertia $inertia) => $inertia ->component('Admin/Web/Screenings/Index') ->has('screenings', 3, fn(AssertableInertia $inertia) => $inertia // ->dd('title') // OK // ->has('title') // Unexpected properties were found in scope [screenings.0]. // Failed asserting that two arrays are identical. ) ->where('screenings.0.title', 'firstDates') // OK ); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi folks, i have some problems with testing. It seems that pest can not handle nested props as documented.
Here my test.
Any ideas?
The text was updated successfully, but these errors were encountered: