-
Notifications
You must be signed in to change notification settings - Fork 2
test: add tests for presets.ts bundle helper functions #60
Copy link
Copy link
Open
Labels
good first issueGood for newcomersGood for newcomerstestingTest improvements and coverageTest improvements and coverage
Description
The presets module (src/presets.ts) provides helper functions that convert preset bundles into typed domain objects: bundlesToDecisions, bundlesToMemories, bundlesToDeployChecklists, bundlesToConfigDefaults, and applyPresetSafetyRules. These are pure functions that take bundle IDs and return structured data, making them easy to test. Currently there are no dedicated tests for these helpers.
Relevant files:
src/presets.ts— the module to testsrc/types.ts—Decision,Memory,SafetyRulestypestest/— place the new test file here aspresets.test.ts
Suggested test cases:
getPresetBundlereturns correct bundle for known IDgetPresetBundlereturns undefined for unknown IDbundlesToDecisionsgenerates sequential D-NNN IDs starting from given startIdbundlesToDecisionsdeduplicates by slug across multiple bundlesbundlesToMemoriessets source to "preset" and sessionId to nullbundlesToDeployChecklistsmerges staging and production items from multiple bundlesapplyPresetSafetyRulesunions deny lists without duplicatesbundlesToConfigDefaultsmerges config from multiple bundles (later wins)
Acceptance criteria:
- New file
test/presets.test.tswith at least 10 tests - All tests pass with
npm test
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomerstestingTest improvements and coverageTest improvements and coverage