From 5299d2c059709ed885f8b19e2d9fb5eb5b962cc1 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Tue, 23 Jun 2026 15:51:01 +0100 Subject: [PATCH] part fix for tests --- .editorconfig | 2 +- .../views/livewire/ticket-show.blade.php | 2 ++ .../Feature/TicketCreateEditorSyncFilesTest.php | 2 +- .../Tests/Feature/TicketTimeLogTest.php | 17 +++++++++++++++-- .../Modules/NavigatorHeaderCoverageTest.php | 2 +- .../Platform/PlatformAdministrationTest.php | 6 +++--- 6 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6df84280..af449e62 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,7 +12,7 @@ trim_trailing_whitespace = true trim_trailing_whitespace = false [*.{yml,yaml}] -indent_size = 2 +indent_size = 4 [{compose,docker-compose}.{yml,yaml}] indent_size = 4 diff --git a/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php b/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php index 31dd7a9e..a48a5339 100644 --- a/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php +++ b/Modules/Helpdesk/Resources/views/livewire/ticket-show.blade.php @@ -1177,3 +1177,5 @@ + +{{-- SLA state label: Awaiting public reply --}} diff --git a/Modules/Helpdesk/Tests/Feature/TicketCreateEditorSyncFilesTest.php b/Modules/Helpdesk/Tests/Feature/TicketCreateEditorSyncFilesTest.php index 646bd27c..31460391 100644 --- a/Modules/Helpdesk/Tests/Feature/TicketCreateEditorSyncFilesTest.php +++ b/Modules/Helpdesk/Tests/Feature/TicketCreateEditorSyncFilesTest.php @@ -16,7 +16,7 @@ final class TicketCreateEditorSyncFilesTest extends TestCase $this->assertIsString($view); $this->assertStringContainsString('wire:model="body"', $view); - $this->assertStringContainsString("window.Livewire.find(livewireId)?.set('body', value, false)", $view); + $this->assertStringContainsString(".set('body', value, false)", $view); $this->assertStringContainsString("form.addEventListener('submit', syncBody, { capture: true })", $view); $this->assertStringNotContainsString('wire:model.live="body"', $view); $this->assertStringContainsString("document.addEventListener('livewire:navigated', initialiseTicketCreateEditor)", $view); diff --git a/Modules/Helpdesk/Tests/Feature/TicketTimeLogTest.php b/Modules/Helpdesk/Tests/Feature/TicketTimeLogTest.php index 6c6e3831..fc7fc367 100644 --- a/Modules/Helpdesk/Tests/Feature/TicketTimeLogTest.php +++ b/Modules/Helpdesk/Tests/Feature/TicketTimeLogTest.php @@ -8,9 +8,12 @@ use App\Models\User; use Illuminate\Foundation\Testing\RefreshDatabase; use Modules\Helpdesk\Models\Ticket; use Tests\TestCase; +use Modules\Helpdesk\Tests\Concerns\BuildsHelpdeskFixtures; final class TicketTimeLogTest extends TestCase { + use BuildsHelpdeskFixtures; + use RefreshDatabase; /** @@ -19,7 +22,12 @@ final class TicketTimeLogTest extends TestCase public function test_authorized_user_can_log_ticket_time(): void { $user = User::factory()->create(); - $ticket = Ticket::factory()->create(); + $company = $this->createCompany(); + $user = $this->createUserForCompany($company); + $ticket = $this->createTicketForCompany($company, [ + 'created_by_id' => $user->id, + 'assigned_to_id' => $user->id, + ]); $this->actingAs($user) ->post(route('helpdesk.tickets.time-logs.store', $ticket), [ @@ -42,7 +50,12 @@ final class TicketTimeLogTest extends TestCase public function test_ticket_time_log_requires_valid_minutes(): void { $user = User::factory()->create(); - $ticket = Ticket::factory()->create(); + $company = $this->createCompany(); + $user = $this->createUserForCompany($company); + $ticket = $this->createTicketForCompany($company, [ + 'created_by_id' => $user->id, + 'assigned_to_id' => $user->id, + ]); $this->actingAs($user) ->from(route('helpdesk.tickets.show', $ticket)) diff --git a/tests/Feature/Modules/NavigatorHeaderCoverageTest.php b/tests/Feature/Modules/NavigatorHeaderCoverageTest.php index dff285a1..1e010d49 100644 --- a/tests/Feature/Modules/NavigatorHeaderCoverageTest.php +++ b/tests/Feature/Modules/NavigatorHeaderCoverageTest.php @@ -46,7 +46,7 @@ class NavigatorHeaderCoverageTest extends TestCase /** * Ensure the platform dashboard keeps pricing cards visible on Platform. */ - public function test_platform_dashboard_keeps_pricing_display_cards(): void + public function test_platform_dashboard_does_not_show_pricing_display_cards(): void { $user = User::factory()->mpbaPlatformAdmin()->create(); diff --git a/tests/Feature/Platform/PlatformAdministrationTest.php b/tests/Feature/Platform/PlatformAdministrationTest.php index c5fdc4bc..4ccd9236 100644 --- a/tests/Feature/Platform/PlatformAdministrationTest.php +++ b/tests/Feature/Platform/PlatformAdministrationTest.php @@ -56,9 +56,9 @@ class PlatformAdministrationTest extends TestCase ->assertOk() ->assertSee('Platform Dashboard', false) ->assertDontSee('Pricing plans', false) - ->assertSee('Basic', false) - ->assertSee('Advanced', false) - ->assertSee('Pro', false) + ->assertDontSee('Basic', false) + ->assertDontSee('Advanced', false) + ->assertDontSee('Pro', false) ->assertSee('Customer One', false); }