From da48e39e2d772dc64c687e9c7fe53d52bb6c66b1 Mon Sep 17 00:00:00 2001 From: ilumos Date: Sun, 15 Sep 2024 17:26:08 +0100 Subject: [PATCH] Fix image tests --- tests/Browser/Tests/Images/DeleteImageTest.php | 5 ++++- tests/Browser/Tests/Images/EditImageTest.php | 2 +- tests/Browser/Tests/Images/UploadImageTest.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Browser/Tests/Images/DeleteImageTest.php b/tests/Browser/Tests/Images/DeleteImageTest.php index c1f56fa5e..b2e5d14f3 100644 --- a/tests/Browser/Tests/Images/DeleteImageTest.php +++ b/tests/Browser/Tests/Images/DeleteImageTest.php @@ -17,7 +17,7 @@ public function testDeleteingImage(): void $browser->loginAs($superAdmin); // And there is an image in the image uploads directory - copy(base_path('public/img/bg.jpg'), storage_path('app/public/images/bg.jpg')); + copy(base_path('resources/images/bg.jpg'), storage_path('app/public/images/bg.jpg')); // When the super admin navigates to the image index page $browser->visitRoute('images.index'); @@ -30,6 +30,9 @@ public function testDeleteingImage(): void // And clicks the "delete" button $browser->clickLink('Delete'); + // And accept the deletion confirmation dialog + $browser->acceptDialog(); + // Then the super admin should be redirected to the image index page $browser->assertRouteIs('images.index'); diff --git a/tests/Browser/Tests/Images/EditImageTest.php b/tests/Browser/Tests/Images/EditImageTest.php index 311d95071..61a1dbb46 100644 --- a/tests/Browser/Tests/Images/EditImageTest.php +++ b/tests/Browser/Tests/Images/EditImageTest.php @@ -17,7 +17,7 @@ public function testEditingImage(): void $browser->loginAs($superAdmin); // And there is an image in the image uploads directory - copy(base_path('public/img/bg.jpg'), storage_path('app/public/images/bg.jpg')); + copy(base_path('resources/images/bg.jpg'), storage_path('app/public/images/bg.jpg')); // When the super admin navigates to the image index page $browser->visitRoute('images.index'); diff --git a/tests/Browser/Tests/Images/UploadImageTest.php b/tests/Browser/Tests/Images/UploadImageTest.php index d3296e542..f7338cb56 100644 --- a/tests/Browser/Tests/Images/UploadImageTest.php +++ b/tests/Browser/Tests/Images/UploadImageTest.php @@ -20,7 +20,7 @@ public function testUploadingImage(): void $browser->visitRoute('images.index'); // And selects a file to upload - $browser->attach('images[]', base_path('public/img/bg.jpg')); + $browser->attach('images[]', base_path('resources/images/bg.jpg')); // And clicks the "upload" button $browser->press('Upload');