Skip to content

Commit 10597cd

Browse files
committed
test: add initial work
1 parent d1da2f7 commit 10597cd

6 files changed

Lines changed: 1623 additions & 31 deletions

File tree

docs/backlog.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,30 @@ At the end: update design doc status → Implemented, update specs to match what
1313

1414
review builder page. do available options change when i make selections? hiding incompatiable things?
1515

16+
## 2 — Bug: `getBuildHash` omits `switchType`
17+
18+
`src/utils/assemblyStepFilter.ts``getBuildHash()` does not include `switchType` in the hash it computes. Changing switch type changes which assembly steps are shown (via `isStepRelevant`), but the hash stays the same, so saved progress is incorrectly preserved across the change instead of being reset.
19+
20+
Fix: add `switchType: choices.switchType` to the `relevantChoices` object in `getBuildHash`.
21+
22+
Test to update: `assemblyStepFilter.test.ts``getBuildHash > BUG: hash does not change when switchType changes` — flip the assertion from `toBe` to `not.toBe` once fixed.
23+
24+
## 3 — Bug: `isStepRelevant` ignores feature requirements of `false`
25+
26+
`src/utils/assemblyStepFilter.ts` — Feature requirements expressed as `false` (e.g. `{ features: { hotswap: false } }`, meaning "only show this step if hotswap is NOT enabled") are silently skipped. The guard `if (required && ...)` short-circuits on `false`, so the step is shown regardless of whether the feature is enabled.
27+
28+
Fix: change the guard to check both directions — hide the step if `required === true` and the feature is off, or if `required === false` and the feature is on.
29+
30+
Test to update: `assemblyStepFilter.test.ts``isStepRelevant > BUG: feature requirement of false is not enforced` — change `toHaveLength(1)` to `toHaveLength(0)` once fixed.
31+
32+
## 4 — Bug: `pcb-kit` case cost overwritten by `ergonomic-3d` layout
33+
34+
`src/utils/costCalculator.ts` — When `buildMethod === 'pcb-kit'` and `layout.formFactor === 'ergonomic-3d'`, the kit's included case cost ($40) is set first then silently overwritten to $20 by the ergonomic-3d check. The $40 drops out of the estimate without trace.
35+
36+
Decide intended behaviour: if the 3D layout requires a custom case that replaces the kit case, the overwrite is correct but should use `+=` or be made explicit. If the kit case cost should be preserved, guard the ergonomic-3d block with `if (!breakdown.case)`.
37+
38+
Test to update: `costCalculator.test.ts``calculateCost > case cost — ergonomic-3d layout > overwrites pcb-kit case cost` — update the expected value and remove the `// BUG` comment once resolved.
39+
1640
## 2
1741

1842
[vite:css][postcss] @import must precede all other statements (besides @charset or empty @layer)

package-lock.json

Lines changed: 31 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)