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,19 @@
|
||||
<?php
|
||||
|
||||
use Modules\Payment\Filament\Widgets\RevenueChartWidget;
|
||||
use Modules\Payment\Models\Payment;
|
||||
|
||||
test('it sums completed payment amounts per day over the last 30 days', function () {
|
||||
Payment::factory()->completed()->create(['amount' => 10000, 'completed_at' => today()]);
|
||||
Payment::factory()->completed()->create(['amount' => 5000, 'completed_at' => today()]);
|
||||
Payment::factory()->create(['amount' => 99999, 'completed_at' => null]); // pending, excluded
|
||||
Payment::factory()->completed()->create(['amount' => 77777, 'completed_at' => today()->subDays(40)]); // outside window
|
||||
|
||||
$widget = new RevenueChartWidget;
|
||||
$getData = (new ReflectionMethod($widget, 'getData'));
|
||||
$getData->setAccessible(true);
|
||||
$data = $getData->invoke($widget);
|
||||
|
||||
expect($data['labels'])->toHaveCount(30)
|
||||
->and(array_sum($data['datasets'][0]['data']))->toBe(15000.0);
|
||||
});
|
||||
Reference in New Issue
Block a user