1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-10-29 23:22:34 +01:00

Updated test to align with image manager HTML changes

This commit is contained in:
Dan Brown 2023-05-29 15:16:16 +01:00
parent cd4b612019
commit 948e95e1ad
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -532,15 +532,15 @@ class ImageTest extends TestCase
$image = Image::first(); $image = Image::first();
$resp = $this->get("/images/edit/{$image->id}"); $resp = $this->get("/images/edit/{$image->id}");
$this->withHtml($resp)->assertElementExists('button#image-manager-delete[title="Delete"]'); $this->withHtml($resp)->assertElementExists('button#image-manager-delete');
$resp = $this->actingAs($viewer)->get("/images/edit/{$image->id}"); $resp = $this->actingAs($viewer)->get("/images/edit/{$image->id}");
$this->withHtml($resp)->assertElementNotExists('button#image-manager-delete[title="Delete"]'); $this->withHtml($resp)->assertElementNotExists('button#image-manager-delete');
$this->permissions->grantUserRolePermissions($viewer, ['image-delete-all']); $this->permissions->grantUserRolePermissions($viewer, ['image-delete-all']);
$resp = $this->actingAs($viewer)->get("/images/edit/{$image->id}"); $resp = $this->actingAs($viewer)->get("/images/edit/{$image->id}");
$this->withHtml($resp)->assertElementExists('button#image-manager-delete[title="Delete"]'); $this->withHtml($resp)->assertElementExists('button#image-manager-delete');
$this->files->deleteAtRelativePath($relPath); $this->files->deleteAtRelativePath($relPath);
} }