test updates

This commit is contained in:
Mark Gregory
2026-06-23 15:47:32 +01:00
parent 5dbc6394b8
commit e76e7de4a3
7 changed files with 5 additions and 95 deletions
@@ -1,88 +0,0 @@
<section
@if ($this->isRunning) wire:poll.1s="refreshTimer" @endif
class="rounded-xl border border-emerald-700/70 bg-emerald-950/40 p-4 text-emerald-50 shadow-sm"
data-helpdesk-ticket-timer
>
<div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
<div class="flex min-w-0 gap-3">
<span class="inline-flex h-14 w-14 shrink-0 items-center justify-center rounded-xl bg-emerald-600 text-white">
<i class="fa-solid fa-stopwatch text-xl" aria-hidden="true"></i>
</span>
<div class="min-w-0">
<h3 class="text-lg font-black text-emerald-50">Work timer</h3>
<p class="mt-1 max-w-sm text-sm font-semibold leading-6 text-emerald-100">
Start a user-specific timer. It remains active if the browser is closed.
</p>
</div>
</div>
@if ($this->isRunning)
<div
class="shrink-0 rounded-xl bg-emerald-600 px-5 py-3 text-center text-white shadow-sm"
data-helpdesk-running-timer
data-dusk="ticket-running-timer-summary"
>
<div class="text-xs font-black uppercase tracking-[0.25em]">
Running
</div>
<div
class="mt-2 font-mono text-2xl font-black"
data-dusk="ticket-running-elapsed-time"
>
{{ $this->elapsedTime }}
</div>
</div>
@endif
</div>
@if ($message)
<div class="mt-4 rounded-xl border border-emerald-700 bg-zinc-950 px-4 py-3 text-sm font-bold text-emerald-50">
{{ $message }}
</div>
@endif
<div class="mt-4 space-y-2">
<label for="ticket-timer-description" class="block text-sm font-bold text-emerald-50">
Timer note
</label>
<textarea
id="ticket-timer-description"
wire:model="description"
rows="3"
placeholder="Optional work note"
class="block w-full rounded-xl border border-emerald-700 bg-zinc-950 p-3 text-sm font-semibold text-emerald-50 shadow-sm placeholder:text-zinc-500 focus:border-emerald-400 focus:ring-emerald-400"
></textarea>
</div>
@error('timer')
<p class="mt-3 text-sm font-bold text-red-300">{{ $message }}</p>
@enderror
<div class="mt-4 flex flex-wrap gap-2">
@if ($this->isRunning)
<button
type="button"
wire:click="endTimer"
wire:loading.attr="disabled"
class="inline-flex items-center justify-center rounded-xl bg-red-600 px-4 py-3 text-sm font-black text-white shadow-sm transition hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-60"
>
<i class="fa-solid fa-stop mr-2" aria-hidden="true"></i>
End timer
</button>
@else
<button
type="button"
wire:click="startTimer"
wire:loading.attr="disabled"
class="inline-flex items-center justify-center rounded-xl bg-emerald-600 px-4 py-3 text-sm font-black text-white shadow-sm transition hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-60"
>
<i class="fa-solid fa-play mr-2" aria-hidden="true"></i>
Start timer
</button>
@endif
</div>
</section>
@@ -1,3 +0,0 @@
@can('update', $ticket)
@livewire('Modules\\Helpdesk\\Livewire\\TicketTimer', ['ticket' => $ticket], key('helpdesk-ticket-timer-'.$ticket->getKey()))
@endcan
@@ -210,6 +210,7 @@ final class TicketConversationTest extends TestCase
->assertHasNoErrors()
->assertDispatched('helpdesk-status-updated')
->set('priority_id', $fixtures['high']->id)
->set('closureComment', 'Closing after agent review.')
->call('updatePriority')
->assertHasNoErrors()
->assertDispatched('helpdesk-priority-updated');
@@ -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("window.Livewire.find(livewireId)?.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);
@@ -69,7 +69,7 @@ class NavigatorHeaderCoverageTest extends TestCase
$this->actingAs($user)
->get(route('platform.dashboard'))
->assertOk()
->assertSee('Pricing plans', false)
->assertDontSee('Pricing plans', false)
->assertSee(route('platform.pricing.index'), false)
->assertSee(route('platform.prices.index'), false);
}
@@ -39,7 +39,7 @@ class PlatformAdministrationTest extends TestCase
/**
* Ensure dashboard renders the single platform header and pricing cards.
*/
public function test_platform_dashboard_renders_counts_pricing_and_recent_companies(): void
public function test_platform_dashboard_renders_counts_without_pricing_cards_and_recent_companies(): void
{
$admin = User::factory()->mpbaPlatformAdmin()->create();
PlatformPrice::query()->delete();
@@ -55,7 +55,7 @@ class PlatformAdministrationTest extends TestCase
->get(route('platform.dashboard'))
->assertOk()
->assertSee('Platform Dashboard', false)
->assertSee('Pricing plans', false)
->assertDontSee('Pricing plans', false)
->assertSee('Basic', false)
->assertSee('Advanced', false)
->assertSee('Pro', false)