f8063b320e8a9a09e4b30f5ed4644f0405cff08f
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
None of these 5 facades had a single test before this - the highest-risk gap flagged in Q7 of the delivery plan: real business logic (dashboard stat computation, health scoring, bulk actions, draft save routing) with zero coverage on domains that just got real backends behind them (Block 3). Each spec stubs the gateway TOKEN via jasmine.createSpyObj, not a concrete class - the correct pattern per this session's earlier fix to admin-analytics.facade.spec.ts / admin-order-watcher.service.spec.ts, so these don't repeat that same latent bug. 66 new tests, several written specifically to catch a real regression class rather than pad a count: - averageRating/averageOrder must be null/0 for an empty set, never NaN or a divide-by-zero artifact - a zero rating must not drag down an average across other real ratings - a customer with 2+ orders counts as returning; 1 order does not - moderationHealthPercent is 100 for an empty queue by convention, not 0 - toggleSelection/toggleAll must not produce duplicate ids - saveDraft must route to createProduct vs updateProduct correctly and must do nothing when no draft is loaded - a real prior bug class (silently creating a duplicate on a no-op save) - an events-load failure in AdminMonitoringFacade must not block queues/ webhooks from loading independently One own mistake caught before commit, not after: the first updateDraft test asserted the updatedAt timestamp changed after two synchronous calls - both landed in the same millisecond, so the ISO string was correctly identical and the assertion was the bug, not the facade. Replaced with an assertion that actually matches what's worth testing (a valid timestamp gets stamped, not that two back-to-back calls differ). Verified: 205/205 unit tests (66 new), arch:check clean, production build succeeds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Description
No description provided
Languages
TypeScript
71.4%
HTML
15.3%
SCSS
11.9%
Shell
1.3%
JavaScript
0.1%