-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathPortalMenuTest.php
36 lines (30 loc) · 1.14 KB
/
PortalMenuTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace Modules\MyBlog\Tests\Feature;
use App\Models\Common\Contact;
use App\Traits\Permissions;
use Tests\Feature\FeatureTestCase;
class PortalMenuTest extends FeatureTestCase
{
use Permissions;
public function testItShouldSeePortalPostsMenuItem()
{
$this->loginAs(Contact::first()->user)
->get(route('portal.dashboard'))
->assertOk()
->assertSeeInOrder([
'<li class="group relative pb-2.5">',
'<a class="flex items-center text-purple" href="' . route('portal.my-blog.posts.index') . '" >',
'<span class="text-sm ltr:ml-2 rtl:mr-2">' . trans_choice('my-blog::general.posts', 2) . '</span>',
], false);
}
public function testItShouldNotSeePortalPostsMenuItem()
{
$this->detachPermissionsFromPortalRoles([
'my-blog-portal-posts' => 'r',
]);
$this->loginAs(Contact::first()->user)
->get(route('portal.dashboard'))
->assertOk()
->assertDontSee('<a class="flex items-center text-purple" href="' . route('portal.my-blog.posts.index') . '" >', false);
}
}