Repository navigation
Accept an explicit model on assembly.cable - #910
Conversation
| test("assembly.cable accepts an explicit model without changing standard behavior", () => { | ||
| const input = { | ||
| name: "C1", | ||
| from: ".J1", | ||
| to: ".J2", | ||
| model: "adaptercable_a(jst_sh_pins4)_b(jst_ph_pins4)", | ||
| } | ||
| expect(assemblyCableProps.parse(input)).toEqual(input) | ||
| for (const model of ["", " ", 4, null]) | ||
| expect(assemblyCableProps.safeParse({ ...input, model }).success).toBe( | ||
| false, | ||
| ) | ||
| }) |
There was a problem hiding this comment.
A *.test.ts file may have AT MOST one test(...) call. The file assembly-cable.test.ts already contained at least one test(...) before this diff, and this change adds another one ("assembly.cable accepts an explicit model without changing standard behavior"). Per the style guide, once a second test is needed the tests must be split into multiple numbered files, e.g. assembly-cable1.test.ts, assembly-cable2.test.ts. Please move this new test into its own numbered file.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
Add optional
AssemblyCableProps.modelfor an explicit cable specification, for example<assembly.cable name="C1" from=".J1" to=".J2" model="adaptercable_a(jst_sh_pins4)_b(jst_ph_pins4)" />. Omit it to retain existing endpoint inference.Existing standards, connector props, and CAD endpoint APIs are unchanged. Update the cable props test and required generated documentation.
Core integration: #4416.