Phase 7 dashboard widgets, Gitea CI, and branded landing page (T7.1)
- BookingsTodayWidget, RecentBookingsTableWidget (Booking module) and RevenueChartWidget, PaymentFailureRateWidget (Payment module) dashboard widgets, auto-registered via each plugin's existing discoverWidgets(). - .gitea/workflows/tests.yml: Postgres-backed Pest run on push/PR. - Landing page (resources/views/welcome.blade.php) now shows the Famous Linnyone4 EV logo with a single admin login link, and the Filament admin panel uses the same logo as its brand logo.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Livewire\Livewire;
|
||||
use Modules\Payment\Filament\Widgets\PaymentFailureRateWidget;
|
||||
use Modules\Payment\Models\Payment;
|
||||
|
||||
test('it computes the failure rate among resolved payments in the last 30 days', function () {
|
||||
$this->actingAs(User::factory()->create());
|
||||
|
||||
Payment::factory()->completed()->create(['initiated_at' => today()]);
|
||||
Payment::factory()->completed()->create(['initiated_at' => today()]);
|
||||
Payment::factory()->completed()->create(['initiated_at' => today()]);
|
||||
Payment::factory()->failed()->create(['initiated_at' => today()]);
|
||||
Payment::factory()->create(['initiated_at' => today()]); // pending, excluded from resolved total
|
||||
Payment::factory()->failed()->create(['initiated_at' => today()->subDays(40)]); // outside window
|
||||
|
||||
Livewire::test(PaymentFailureRateWidget::class)
|
||||
->assertOk()
|
||||
->assertSee('25%')
|
||||
->assertSee('1 failed of 4 resolved (last 30 days)');
|
||||
});
|
||||
Reference in New Issue
Block a user