I finished the remaining reliability, sharing, performance, and polish items across the admin
app.
What’s done
locales/en/mobile.json and resources/js/admin/i18n/locales/de/mobile.json.
- Error recovery CTAs on Photos, Notifications, Tasks, and QR screens so users can retry without a full reload in resources/js/admin/mobile/EventPhotosPage.tsx, resources/js/admin/mobile/NotificationsPage.tsx, resources/js/admin/
mobile/EventTasksPage.tsx, resources/js/admin/mobile/QrPrintPage.tsx.
- QR share uses native share sheet when available, with clipboard fallback in resources/js/admin/mobile/
QrPrintPage.tsx.
- Lazy‑loaded photo grid thumbnails for better performance in resources/js/admin/mobile/EventPhotosPage.tsx.
- New helper + tests for queue count logic in resources/js/admin/mobile/lib/queueStatus.ts and resources/js/admin/
mobile/lib/queueStatus.test.ts.
This commit is contained in:
23
resources/js/admin/mobile/lib/queueStatus.test.ts
Normal file
23
resources/js/admin/mobile/lib/queueStatus.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import type { PhotoModerationAction } from './photoModerationQueue';
|
||||
import { countQueuedPhotoActions } from './queueStatus';
|
||||
|
||||
const baseAction = (overrides: Partial<PhotoModerationAction>): PhotoModerationAction => ({
|
||||
id: overrides.id ?? '1',
|
||||
eventSlug: overrides.eventSlug ?? 'event-a',
|
||||
photoId: overrides.photoId ?? 1,
|
||||
action: overrides.action ?? 'approve',
|
||||
createdAt: overrides.createdAt ?? new Date().toISOString(),
|
||||
});
|
||||
|
||||
describe('countQueuedPhotoActions', () => {
|
||||
it('returns total count when slug is not provided', () => {
|
||||
const queue = [baseAction({ id: '1' }), baseAction({ id: '2', eventSlug: 'event-b' })];
|
||||
expect(countQueuedPhotoActions(queue)).toBe(2);
|
||||
});
|
||||
|
||||
it('filters by slug when provided', () => {
|
||||
const queue = [baseAction({ id: '1' }), baseAction({ id: '2', eventSlug: 'event-b' })];
|
||||
expect(countQueuedPhotoActions(queue, 'event-a')).toBe(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user