livewire / livewire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
MIT License
21.94k stars 1.5k forks source link

Fix Test: Enhance Wait for Preview in Test #8535

Closed Lucasczm closed 1 month ago

Lucasczm commented 1 month ago

This PR makes a small code change to improve waiting behavior during the test.

Change Test Browser file src/Features/SupportFileUploads/BrowserTest.php, function test_can_upload_preview_and_save_a_file

I replaced the line ->wait(250), which ensures that the test waits until the element with the selector @preview is available before proceeding. This should enhance test reliability and ensure proper loading of the preview.

    ->assertMissing('@preview')
    ->attach('@upload', __DIR__ . '/browser_test_image.png')
-   ->wait(250)
+   ->waitFor('@preview')
    ->assertVisible('@preview')

Please review and approve if you agree! 😊👍

calebporzio commented 1 month ago

Lovely thanks!