sdarbinyan f8063b320e
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
test: facade coverage for orders, moderation, transactions, monitoring, products (F63 partial)
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>
2026-08-18 21:38:42 +04:00
2026-07-19 15:28:35 +04:00
2026-01-18 18:57:06 +04:00
2026-06-01 00:47:26 +04:00
2026-01-18 18:57:06 +04:00
2026-03-24 02:25:50 +04:00
2026-07-09 01:40:22 +04:00
2026-05-28 12:56:41 +00:00
2026-06-21 23:42:39 +04:00
Description
No description provided
16 MiB
Languages
TypeScript 71.4%
HTML 15.3%
SCSS 11.9%
Shell 1.3%
JavaScript 0.1%