Updated default image and added additional admin cards

This commit is contained in:
blaisadmin
2026-04-30 22:25:15 -04:00
parent cd7c4383d0
commit 45fd507eeb
7 changed files with 44 additions and 0 deletions
@@ -6,6 +6,7 @@ import {
deleteWorkspaceIfEmpty,
ensurePersonalWorkspaceForUser,
findAlternateWorkspaceForUser,
getPlatformAdminSummary,
listOwnedWorkspacesByOwnerEmail,
updateWorkspace,
} from './workspaceRepository.js';
@@ -179,3 +180,30 @@ test('listOwnedWorkspacesByOwnerEmail resolves accepted owner flocks by email',
assert.match(calls[0].text, /accepted_at IS NOT NULL/);
assert.match(calls[0].text, /workspaces\.id <> \$2/);
});
test('getPlatformAdminSummary counts memorialized birds separately', async () => {
const { calls } = mockDb({
rowCount: 1,
rows: [
{
total_birds: 8,
memorialized_birds: 3,
total_users: 4,
total_workspaces: 2,
rescue_workspaces: 1,
rescue_birds: 5,
pending_rescues: 1,
daily_users: 2,
},
],
});
const summary = await getPlatformAdminSummary();
assert.equal(summary?.memorialized_birds, 3);
assert.equal(calls.length, 1);
assert.match(calls[0].text, /memorialized_birds/);
assert.match(calls[0].text, /memorialized_at IS NOT NULL/);
assert.match(calls[0].text, /rescue_birds/);
assert.match(calls[0].text, /workspaces\.workspace_type = 'rescue'/);
});