User Story
As a developer maintaining the inventory permission tests,
I want the test runner to correctly parse TypeScript `import type` syntax and have meaningful assertions for the view-only org inventory path,
So that CI catches regressions in the org inventory permission gating.
Definition of Done
Acceptance Criteria
Technical Elaboration
Two issues surfaced during ISSUE-163 / PR #166 review:
1. Babel config: The frontend Jest suite uses Babel but does not handle `import type`. Adding `import type { LocationRecord }` to the test file caused a parse error: `Unexpected token, expected "from"`. Fix by adding the appropriate Babel plugin or switching this suite to ts-jest.
2. Weak assertion: The test for view-only users (`can_view_org_inventory` only) currently asserts `screen.getByText('Test Org')` after selecting the org — but that text was already in the dropdown before selection, so it doesn't prove `getOrgInventory` ran. The test should:
- Mock `getOrgInventory` to return a distinct item (e.g. `'Org Exclusive Item'`)
- Assert that item appears after org selection
- Assert `mockGetOrgInventory` was called with `orgId: 42`
Design Elaboration
Low-priority follow-up to ISSUE-163. No UX or security impact — purely test infrastructure.
User Story
As a developer maintaining the inventory permission tests,
I want the test runner to correctly parse TypeScript `import type` syntax and have meaningful assertions for the view-only org inventory path,
So that CI catches regressions in the org inventory permission gating.
Definition of Done
Acceptance Criteria
Technical Elaboration
Two issues surfaced during ISSUE-163 / PR #166 review:
1. Babel config: The frontend Jest suite uses Babel but does not handle `import type`. Adding `import type { LocationRecord }` to the test file caused a parse error: `Unexpected token, expected "from"`. Fix by adding the appropriate Babel plugin or switching this suite to ts-jest.
2. Weak assertion: The test for view-only users (`can_view_org_inventory` only) currently asserts `screen.getByText('Test Org')` after selecting the org — but that text was already in the dropdown before selection, so it doesn't prove `getOrgInventory` ran. The test should:
Design Elaboration
Low-priority follow-up to ISSUE-163. No UX or security impact — purely test infrastructure.