Skip to content

Commit

Permalink
formatbot: Automatically format code
Browse files Browse the repository at this point in the history
  • Loading branch information
tscircuitbot committed Nov 7, 2024
1 parent f388171 commit b1d2560
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/components/base-components/NormalComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ export class NormalComponent<
*/
doInitialPortDiscovery(): void {
const { _parsedProps: props } = this

// Only get ports from footprint and schematic if no schPortArrangement
let newPorts: Port[] = []
if (!props.schPortArrangement) {
Expand All @@ -560,11 +560,11 @@ export class NormalComponent<
...this.getPortsFromSchematicSymbol(),
]
}

const existingPorts = this.children.filter(
(c) => c.componentName === "Port",
) as Port[]

for (const newPort of newPorts) {
const existingPort = existingPorts.find((p) =>
p.isMatchingAnyOf(newPort.getNameAndAliases()),
Expand Down
4 changes: 2 additions & 2 deletions tests/hooks/use-led.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ test("useLed hook creates component with correct props and traces", () => {
expect(leds.length).toBe(2)
expect(leds[0].props.name).toBe("LED1")
expect(leds[0].props.footprint).toBe("1206")
expect(leds[1].props.name).toBe("LED2")
expect(leds[1].props.name).toBe("LED2")
expect(leds[1].props.footprint).toBe("0603")

// Check if traces were created correctly
const traces = circuit.selectAll("trace")
expect(traces.length).toBe(4)
})
})

0 comments on commit b1d2560

Please sign in to comment.