Repository navigation
test: reproduce AM3352 power probe Circuit JSON import failure - #4851
rushabhcodes wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
| import { getTestFixture } from "./get-test-fixture" | ||
|
|
||
| export const getTestPointInflationFixture = async () => { | ||
| const { circuit: original } = getTestFixture() | ||
| // Power-output probe from the AM3352 SBC's USB-C PD supply: | ||
| // https://github.com/tscircuit/am3352-sbc/blob/bc85a52da8dcad023a3721ca9c90f7a9d29ea3d6/design/pd-power.tsx | ||
| // nets.tsx expands Cap to an 0805 capacitor with pin1 on VIN_5V. | ||
| // Extract only the VIN_5V probe connection; the capacitor's GND connection | ||
| // and the rest of the power supply are outside this regression. | ||
| // Keep the original names, values, pad size and 5 mm spacing; translate both | ||
| // parts by (+35.5, +18) mm to center this excerpt on a small test board. | ||
| // Route only this extracted circuit locally, then import its saved copper. | ||
| original.add( | ||
| <board width={14} height={8}> | ||
| <capacitor | ||
| name="C_PD_OUT" | ||
| capacitance="10uF" | ||
| footprint="0805" | ||
| pcbX={-2.5} | ||
| /> | ||
| <testpoint | ||
| name="TP_5V" | ||
| footprintVariant="pad" | ||
| padDiameter={1.5} | ||
| pcbX={2.5} | ||
| /> | ||
| <trace from=".C_PD_OUT > .pin1" to="net.VIN_5V" /> | ||
| <trace from=".TP_5V > .pin1" to="net.VIN_5V" /> | ||
| </board>, | ||
| ) | ||
| await original.renderUntilSettled() | ||
|
|
||
| const { circuit: imported } = getTestFixture() | ||
| let importError: Error | undefined | ||
| try { | ||
| imported.add( | ||
| <board | ||
| width={14} | ||
| height={8} | ||
| routingDisabled | ||
| circuitJson={original.getCircuitJson()} | ||
| />, | ||
| ) | ||
| await imported.renderUntilSettled() | ||
| } catch (error) { | ||
| if ( | ||
| !(error instanceof Error) || | ||
| error.message !== | ||
| 'No inflator implemented for source component ftype: "simple_test_point"' | ||
| ) { | ||
| throw error | ||
| } | ||
| importError = error | ||
| } | ||
|
|
||
| return { original, imported, importError } | ||
| } |
There was a problem hiding this comment.
File naming inconsistency: The fixture file is named get-testpoint-inflation-fixture.tsx but the exported function is getTestPointInflationFixture. The file name uses testpoint (no camel-case boundary between 'test' and 'point'), while the export name uses TestPoint (with a capital P). For consistency, the file should be named get-test-point-inflation-fixture.tsx to match the export name getTestPointInflationFixture, similar to how the imported get-test-fixture file matches its export getTestFixture. Variable naming and file naming should be consistent relative to other variable or file names in the project.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
8f16daf to
3b5347b
Compare
Importing saved Circuit JSON containing a native
<testpoint />throwsNo inflator implemented for source component ftype: "simple_test_point".Reproduce #4525 with the AM3352 SBC's USB-C 5 V output probe, extracted from the pinned power-supply design. The fixture keeps
C_PD_OUT(10 µF, 0805),TP_5V(1.5 mm pad), their 5 mm spacing, and theirVIN_5Vconnections. Both parts are translated together to center the excerpt on a small board. Only this power-net connection is included; routing is generated locally for the excerpt.A
test.failingregression checks that the saved probe, ports, net connections, copper, and silkscreen survive importing. A separate passing visual test requires the exact missing-inflator exception and verifies the source has real routed copper and no circuit errors, so an unrelated failure cannot satisfy the reproduction.Validation: both reproduction tests pass on unchanged production code with Bun 1.4.2; the paired SVG was rendered and inspected.
First layer of native GitHub stack, followed by fix #4852. Matching branches are also published in
rushabhcodes/core.