diff --git a/docs/superpowers/plans/2026-05-29-bilingual-dropdown-options.md b/docs/superpowers/plans/2026-05-29-bilingual-dropdown-options.md index cfe89d6..04602fc 100644 --- a/docs/superpowers/plans/2026-05-29-bilingual-dropdown-options.md +++ b/docs/superpowers/plans/2026-05-29-bilingual-dropdown-options.md @@ -6,7 +6,9 @@ **Architecture:** Two seams. (1) DB-backed lookups (giving categories, ministries, expense category groups/subs) already carry `name_en` + `name_zh`; their API services compute a display-only `label = bilingual(name_en, name_zh)` at load time and templates bind `textField="label"`. (2) Hard-coded enum dropdowns (payment method, expense status, member status, gender, language, roles) move to a central `shared/i18n/option-lists.ts` of `{value,label}` arrays. A single `bilingual()` helper produces the `英文/中文` string. Values bound into forms/DB are unchanged. -**Tech Stack:** Angular 20 (standalone components), Kendo UI for Angular v20 (DropDownList / MultiSelect), Karma + Jasmine (`ng test`), Tailwind v4 for layout. Spec: `docs/superpowers/specs/2026-05-29-bilingual-dropdown-options-design.md`. +**Tech Stack:** Angular 20 (standalone components), Kendo UI for Angular v20 (DropDownList / MultiSelect), Karma + Jasmine, Tailwind v4 for layout. Spec: `docs/superpowers/specs/2026-05-29-bilingual-dropdown-options-design.md`. + +**Test command:** This repo has no `test:ci` script — run unit tests single-run headless with `npx ng test --watch=false --browsers=ChromeHeadless` (from `APP/`). If ChromeHeadless cannot launch in this environment, report it; the helper/option-lists are still type-checked by `ng build`. **Conventions to honor:** - Kendo: whenever `textField`/`valueField` are set against an object array, also set `[valuePrimitive]="true"` so the form binds the scalar value, not the whole object. @@ -81,7 +83,7 @@ describe('bilingual', () => { - [ ] **Step 2: Run test to verify it fails** -Run: `cd APP && npm run test:ci` +Run: `cd APP && npx ng test --watch=false --browsers=ChromeHeadless` Expected: FAIL — `Cannot find module './bilingual'` (compilation error). - [ ] **Step 3: Write minimal implementation** @@ -99,7 +101,7 @@ export const bilingual = (en: string, zh?: string | null): string => - [ ] **Step 4: Run test to verify it passes** -Run: `cd APP && npm run test:ci` +Run: `cd APP && npx ng test --watch=false --browsers=ChromeHeadless` Expected: PASS (4 specs in the `bilingual` suite). - [ ] **Step 5: Commit** @@ -162,7 +164,7 @@ describe('option-lists', () => { - [ ] **Step 2: Run test to verify it fails** -Run: `cd APP && npm run test:ci` +Run: `cd APP && npx ng test --watch=false --browsers=ChromeHeadless` Expected: FAIL — `Cannot find module './option-lists'`. - [ ] **Step 3: Write minimal implementation** @@ -230,7 +232,7 @@ export const ROLE_OPTIONS: readonly BilingualOption[] = [ - [ ] **Step 4: Run test to verify it passes** -Run: `cd APP && npm run test:ci` +Run: `cd APP && npx ng test --watch=false --browsers=ChromeHeadless` Expected: PASS (all `option-lists` specs). - [ ] **Step 5: Commit** @@ -642,7 +644,7 @@ Expected: succeeds with no errors. - [ ] **Step 2: Run the unit suites** -Run: `cd APP && npm run test:ci` +Run: `cd APP && npx ng test --watch=false --browsers=ChromeHeadless` Expected: `bilingual` and `option-lists` suites PASS (and no previously-passing suite regresses). - [ ] **Step 3: Start the app and verify in the browser preview**