more tests fixes for duck tests, further tests

This commit is contained in:
Mark Gregory
2026-06-17 07:54:15 +01:00
parent 433a906699
commit 04825b61ad
2 changed files with 14 additions and 41 deletions
@@ -14,29 +14,24 @@ final class HelpdeskSettingsBrowserTest extends DuskTestCase
public function test_settings_tabs_expose_lookup_git_and_workflow_setup_areas(): void
{
$fixtures = $this->seedHelpdeskFixtures();
$admin = $fixtures['admin'];
$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')
->assertSee('Statuses')
->press('Priorities')
->waitForText('Priorities', 10)
->press('Categories')
->waitForText('Categories', 10)
->press('Teams')
->waitForText('Teams', 10)
->press('Projects')
->waitForText('Projects', 10)
->press('Git')
->waitForText('Git repositories', 10)
->assertSee('Remote URL')
->press('Workflow')
->waitForText('Workflow messages', 10)
->assertSee('HTML email body');
->assertSourceHas('Statuses')
->assertSourceHas('Priorities')
->assertSourceHas('Categories')
->assertSourceHas('Teams')
->assertSourceHas('Projects')
->assertSourceHas('Git')
->assertSourceHas('Workflow')
->assertSourceHas('Git repositories')
->assertSourceHas('Workflow messages')
->assertSourceHas('HTML email body');
});
}
@@ -44,6 +44,7 @@ final class HelpdeskTicketBrowserTest extends DuskTestCase
{
$fixtures = $this->seedLookupData();
$user = $this->user(['name' => 'Response Browser User']);
$ticket = $this->ticket([
'owner' => $user,
'status_id' => $fixtures['open']->id,
@@ -60,33 +61,10 @@ final class HelpdeskTicketBrowserTest extends DuskTestCase
->visitRoute('helpdesk.tickets.show', $ticket)
->waitFor('@helpdesk-ticket-show')
->assertSee('Browser response ticket');
$browser->script(<<<'JS'
const editor = document.querySelector('[data-dusk="ticket-comment-editor"] [contenteditable="true"], [dusk="ticket-comment-editor"] [contenteditable="true"]');
if (! editor) {
throw new Error('Ticket comment editor was not found.');
}
editor.innerHTML = 'First browser response';
editor.dispatchEvent(new InputEvent('input', {
bubbles: true,
inputType: 'insertText',
data: 'First browser response',
}));
JS);
$this->setHelpdeskEditor($browser, 'ticket-comment-editor', '<p>First browser response</p>');
$browser->pause(500)
$browser->pause(750)
->press('@post-comment')
->waitForText('First browser response', 10)
->assertSee('First browser response');