48 lines
1.8 KiB
PHP
Executable File
48 lines
1.8 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Helpdesk\Tests\Browser;
|
|
|
|
use Laravel\Dusk\Browser;
|
|
use Modules\Helpdesk\Tests\Concerns\BuildsHelpdeskFixtures;
|
|
use Tests\DuskTestCase;
|
|
|
|
final class HelpdeskSettingsBrowserTest extends DuskTestCase
|
|
{
|
|
use BuildsHelpdeskFixtures;
|
|
|
|
public function test_settings_tabs_expose_lookup_git_and_workflow_setup_areas(): void
|
|
{
|
|
$this->seedLookupData();
|
|
$admin = $this->admin(['name' => 'Helpdesk Settings Admin']);
|
|
|
|
$this->browse(function (Browser $browser) use ($admin): void {
|
|
$browser->loginAs($admin)
|
|
->visitRoute('helpdesk.settings')
|
|
->waitFor('@helpdesk-settings-manager')
|
|
->assertSee('Support configuration')
|
|
->assertSourceMissing("route('helpdesk.tickets.index')")
|
|
->assertSourceMissing("route('helpdesk.tickets.create')")
|
|
->assertSourceMissing("route('helpdesk.kanban')")
|
|
->assertDontSee('+ New Ticket')
|
|
->assertDontSee('Kanban');
|
|
|
|
$this->openSettingsSection($browser, 'statuses', 'Statuses');
|
|
$this->openSettingsSection($browser, 'priorities', 'Priorities');
|
|
$this->openSettingsSection($browser, 'categories', 'Categories');
|
|
$this->openSettingsSection($browser, 'teams', 'Teams');
|
|
$this->openSettingsSection($browser, 'projects', 'Projects');
|
|
$this->openSettingsSection($browser, 'git', 'Remote URL');
|
|
$this->openSettingsSection($browser, 'workflow', 'HTML email body');
|
|
});
|
|
}
|
|
|
|
private function openSettingsSection(Browser $browser, string $section, string $expectedHeading): Browser
|
|
{
|
|
return $browser
|
|
->click('@helpdesk-settings-section-' . $section)
|
|
->waitForText($expectedHeading, 10);
|
|
}
|
|
}
|