learning_ai_common_plat/services/platform-service/src
saravanakumardb1 cde1a0b73c test(platform-service): align getAllProducts test with invttrdg fallback
CI run 67 surfaced a real test failure:

  src/modules/products/cache.test.ts:104
    getAllProducts > returns all cached products
    expected [ { id: 'lysnrai', …(11) }, …(2) ] to have a length of 2
    but got 3

Root cause: cache.ts has a TEMPORARY_FALLBACK_PRODUCTS map (currently
just 'invttrdg') that getAllProducts() merges into its return value
on top of the loaded cache. The test fixture loads 2 products
(lysnrai, mindlyst), so the actual return is 3 — the test was
written before the fallback shim landed and never got updated.

Two ways to reconcile: (a) make the test reflect today's behaviour,
or (b) gut the fallback. The cache.ts comment explicitly marks
the fallback as 'TODO(platform): remove after creating the real
product …', so the right move is (a): keep the shim in place and
make the test enforce the documented contract.

  - assertion now: toHaveLength(3) + .toContain('invttrdg')
  - inline comment ties the expectation back to cache.ts so a
    future cleanup removing the fallback will obviously need to
    drop it back to 2

Verified locally:
  pnpm vitest run cache.test.ts   -> 8/8 pass
2026-05-23 17:23:16 -07:00
..
lib chore(platform): replace runtime console diagnostics 2026-05-04 16:48:25 -07:00
migrations refactor(platform-service): migrate webhooks/routes and migrations/runner from cosmos.js to datastore 2026-03-02 02:02:47 -08:00
modules test(platform-service): align getAllProducts test with invttrdg fallback 2026-05-23 17:23:16 -07:00
nodemailer.d.ts feat(platform-service): add smtp email delivery and postal setup 2026-03-14 05:52:28 +00:00
server.test.ts feat(runtime): add platform runtime projection api 2026-04-04 01:14:37 -07:00
server.ts fix(platform-service): resolve 3 TS errors in /devops/info handler 2026-05-23 12:46:10 -07:00