From aeaf2b263c2eb6c65f933aee40789e783bb06f78 Mon Sep 17 00:00:00 2001 From: seveibar Date: Thu, 7 Nov 2024 12:18:20 -0800 Subject: [PATCH] fix other people's code --- lib/components/base-components/NormalComponent.ts | 6 +++--- tests/hooks/use-led.test.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/components/base-components/NormalComponent.ts b/lib/components/base-components/NormalComponent.ts index 91e7717..b6aa1f3 100644 --- a/lib/components/base-components/NormalComponent.ts +++ b/lib/components/base-components/NormalComponent.ts @@ -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) { @@ -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()), diff --git a/tests/hooks/use-led.test.tsx b/tests/hooks/use-led.test.tsx index f24e1e4..67a7350 100644 --- a/tests/hooks/use-led.test.tsx +++ b/tests/hooks/use-led.test.tsx @@ -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) -}) \ No newline at end of file +})