fixed spell checker issue and alos git commit at ticket level
This commit is contained in:
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Modules\Helpdesk\Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* Guards browser-native spellcheck wiring on Helpdesk ticket create and edit forms.
|
||||
@@ -16,22 +16,22 @@ final class TicketCreateEditSpellcheckFilesTest extends TestCase
|
||||
*/
|
||||
public function test_create_ticket_subject_and_body_keep_native_spellcheck_hints(): void
|
||||
{
|
||||
$view = file_get_contents(base_path('Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php'));
|
||||
$editor = file_get_contents(base_path('Modules/Helpdesk/Resources/views/components/html-editor.blade.php'));
|
||||
$view = file_get_contents(__DIR__ . '/../../Resources/views/livewire/ticket-create.blade.php');
|
||||
$editor = file_get_contents(__DIR__ . '/../../Resources/views/components/html-editor.blade.php');
|
||||
|
||||
$this->assertIsString($view);
|
||||
$this->assertIsString($editor);
|
||||
self::assertIsString($view);
|
||||
self::assertIsString($editor);
|
||||
|
||||
$this->assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view);
|
||||
$this->assertStringContainsString('model="body"', $view);
|
||||
$this->assertStringContainsString('editor-dusk="ticket-body-editor"', $view);
|
||||
$this->assertStringContainsString('contenteditable="true"', $editor);
|
||||
$this->assertStringContainsString('spellcheck="true"', $editor);
|
||||
$this->assertStringContainsString('lang="en-GB"', $editor);
|
||||
$this->assertStringContainsString('autocorrect="on"', $editor);
|
||||
$this->assertStringContainsString('autocomplete="on"', $editor);
|
||||
$this->assertStringContainsString('autocapitalize="sentences"', $editor);
|
||||
$this->assertStringContainsString('data-helpdesk-spellcheck-mirror="{{ $model }}"', $editor);
|
||||
self::assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view);
|
||||
self::assertStringContainsString('model="body"', $view);
|
||||
self::assertStringContainsString('editor-dusk="ticket-body-editor"', $view);
|
||||
self::assertStringContainsString('contenteditable="true"', $editor);
|
||||
self::assertStringContainsString('spellcheck="true"', $editor);
|
||||
self::assertStringContainsString('lang="en-GB"', $editor);
|
||||
self::assertStringContainsString('autocorrect="on"', $editor);
|
||||
self::assertStringContainsString('autocomplete="on"', $editor);
|
||||
self::assertStringContainsString('autocapitalize="sentences"', $editor);
|
||||
self::assertStringContainsString('data-helpdesk-spellcheck-mirror="{{ $model }}"', $editor);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,13 +39,15 @@ final class TicketCreateEditSpellcheckFilesTest extends TestCase
|
||||
*/
|
||||
public function test_edit_ticket_subject_and_body_keep_native_spellcheck_hints(): void
|
||||
{
|
||||
$view = file_get_contents(base_path('Modules/Helpdesk/Resources/views/livewire/ticket-edit.blade.php'));
|
||||
$view = file_get_contents(__DIR__ . '/../../Resources/views/livewire/ticket-edit.blade.php');
|
||||
$editor = file_get_contents(__DIR__ . '/../../Resources/views/components/html-editor.blade.php');
|
||||
|
||||
$this->assertIsString($view);
|
||||
self::assertIsString($view);
|
||||
self::assertIsString($editor);
|
||||
|
||||
$this->assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view);
|
||||
$this->assertStringContainsString('model="body"', $view);
|
||||
$this->assertStringContainsString('editor-dusk="ticket-edit-body-editor"', $view);
|
||||
$this->assertStringNotContainsString('wire:model="body" label="Details *"', $view);
|
||||
self::assertStringContainsString('id="subject" type="text" spellcheck="true" lang="en-GB" autocorrect="on" autocomplete="on" autocapitalize="sentences" inputmode="text"', $view);
|
||||
self::assertStringContainsString('model="body"', $view);
|
||||
self::assertStringContainsString('editor-dusk="ticket-edit-body-editor"', $view);
|
||||
self::assertStringContainsString('data-helpdesk-spellcheck-mirror="{{ $model }}"', $editor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,19 @@ final class TicketGitCommitDisplayFilesTest extends TestCase
|
||||
self::assertStringNotContainsString('lower(message) like', strtolower($component));
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly linked commits must still display even when historical repository ownership is inconsistent.
|
||||
*/
|
||||
public function test_ticket_show_keeps_directly_linked_git_commits_visible_before_repository_scope(): void
|
||||
{
|
||||
$component = file_get_contents(__DIR__ . '/../../Livewire/TicketShow.php');
|
||||
|
||||
self::assertIsString($component);
|
||||
self::assertStringContainsString("\$scopeQuery->where('ticket_id', \$ticket->id)", $component);
|
||||
self::assertStringContainsString("->orWhereHas('repository'", $component);
|
||||
self::assertStringContainsString("HD-2026-00026", "HD-2026-00026");
|
||||
}
|
||||
|
||||
public function test_ticket_show_preserves_livewire_safe_expandable_sidebar_cards(): void
|
||||
{
|
||||
$view = file_get_contents(__DIR__ . '/../../Resources/views/livewire/ticket-show.blade.php');
|
||||
|
||||
Reference in New Issue
Block a user