From a78ea5f74bfc3fa3b6d3351846b33e5af0162acf Mon Sep 17 00:00:00 2001 From: mohan-bee Date: Fri, 4 Sep 2026 14:06:13 +0530 Subject: [PATCH] up --- ...benchmark-four-sections-schematic.snap.svg | 152 +++++ .../kicad-benchmark-four-sections.fixture.tsx | 637 ++++++++++++++++++ .../kicad-benchmark-four-sections.test.tsx | 23 + 3 files changed, 812 insertions(+) create mode 100644 tests/repros/__snapshots__/kicad-benchmark-four-sections-schematic.snap.svg create mode 100644 tests/repros/fixtures/kicad-benchmark-four-sections.fixture.tsx create mode 100644 tests/repros/kicad-benchmark-four-sections.test.tsx diff --git a/tests/repros/__snapshots__/kicad-benchmark-four-sections-schematic.snap.svg b/tests/repros/__snapshots__/kicad-benchmark-four-sections-schematic.snap.svg new file mode 100644 index 000000000..b687bd6cd --- /dev/null +++ b/tests/repros/__snapshots__/kicad-benchmark-four-sections-schematic.snap.svg @@ -0,0 +1,152 @@ +-11,-5-11,-4-11,-3-11,-2-11,-1-11,0-11,1-11,2-11,3-11,4-11,5-11,6-11,7-11,8-10,-5-10,-4-10,-3-10,-2-10,-1-10,0-10,1-10,2-10,3-10,4-10,5-10,6-10,7-10,8-9,-5-9,-4-9,-3-9,-2-9,-1-9,0-9,1-9,2-9,3-9,4-9,5-9,6-9,7-9,8-8,-5-8,-4-8,-3-8,-2-8,-1-8,0-8,1-8,2-8,3-8,4-8,5-8,6-8,7-8,8-7,-5-7,-4-7,-3-7,-2-7,-1-7,0-7,1-7,2-7,3-7,4-7,5-7,6-7,7-7,8-6,-5-6,-4-6,-3-6,-2-6,-1-6,0-6,1-6,2-6,3-6,4-6,5-6,6-6,7-6,8-5,-5-5,-4-5,-3-5,-2-5,-1-5,0-5,1-5,2-5,3-5,4-5,5-5,6-5,7-5,8-4,-5-4,-4-4,-3-4,-2-4,-1-4,0-4,1-4,2-4,3-4,4-4,5-4,6-4,7-4,8-3,-5-3,-4-3,-3-3,-2-3,-1-3,0-3,1-3,2-3,3-3,4-3,5-3,6-3,7-3,8-2,-5-2,-4-2,-3-2,-2-2,-1-2,0-2,1-2,2-2,3-2,4-2,5-2,6-2,7-2,8-1,-5-1,-4-1,-3-1,-2-1,-1-1,0-1,1-1,2-1,3-1,4-1,5-1,6-1,7-1,80,-50,-40,-30,-20,-10,00,10,20,30,40,50,60,70,81,-51,-41,-31,-21,-11,01,11,21,31,41,51,61,71,82,-52,-42,-32,-22,-12,02,12,22,32,42,52,62,72,83,-53,-43,-33,-23,-13,03,13,23,33,43,53,63,73,84,-54,-44,-34,-24,-14,04,14,24,34,44,54,64,74,85,-55,-45,-35,-25,-15,05,15,25,35,45,55,65,75,86,-56,-46,-36,-26,-16,06,16,26,36,46,56,66,76,87,-57,-47,-37,-27,-17,07,17,27,37,47,57,67,77,88,-58,-48,-38,-28,-18,08,18,28,38,48,58,68,78,89,-59,-49,-39,-29,-19,09,19,29,39,49,59,69,79,810,-510,-410,-310,-210,-110,010,110,210,310,410,510,610,710,8USB4105-GF-AJ11GND12VBUS13CC14DP15DM16SBU17SBU28DM29DP210CC211VBUS212GND213SHELL114SHELL215SHELL316SHELL4RCC15.1kΩRCC25.1kΩCP2102N-A02-GQFN24U21RST2GPIO03GPIO14GND5DPLUS6DMINUS7REGIN8VDD9VIO10SUSPEND11SUSPEND_N12WAKEUP13RI14DCD15DTR16DSR17TXD18RXD19RTS20CTS21GPIO222GPIO323CHREN24NC25EPCUSB1uFAP2112K-3.3TRG1U31VIN2GND3EN4NC5VOUTCIN10uFCOUT10uFESP-12FU11RESET2ADC3EN4GPIO165GPIO146GPIO127GPIO138VCC15GND16GPIO1517GPIO218GPIO019GPIO420GPIO521RXD22TXDC1100nFC210uFJ_GPIO12345678REN10kΩRRST10kΩRBOOT10kΩR1510kΩSW_RSTSW_BOOTgreenLED_PWRRPWR1kΩblueLED_TXRTX1kΩamberLED_IO2RIO21kΩGNDGNDGNDGNDGNDGNDGNDVBUSVBUSVBUSU2_VDDU2_VDDU2_TXDU2_TXDU2_TXDV3V3V3V3V3V3V3V3U1_GPIO16U1_GPIO16U1_GPIO14U1_GPIO14U1_GPIO13U1_GPIO13U1_GPIO15U1_GPIO15U1_GPIO2U1_GPIO2U1_GPIO4U1_GPIO4U1_GPIO5U1_GPIO5BOOT / STATUSU1_RESETU1_RESETU1_GPIO0U1_GPIO0U1_GPIO0U2_RXDU2_RXDU1_ENU1_EN \ No newline at end of file diff --git a/tests/repros/fixtures/kicad-benchmark-four-sections.fixture.tsx b/tests/repros/fixtures/kicad-benchmark-four-sections.fixture.tsx new file mode 100644 index 000000000..71e52347a --- /dev/null +++ b/tests/repros/fixtures/kicad-benchmark-four-sections.fixture.tsx @@ -0,0 +1,637 @@ +const espPins = { + pin1: "RESET", + pin2: "ADC", + pin3: "EN", + pin4: "GPIO16", + pin5: "GPIO14", + pin6: "GPIO12", + pin7: "GPIO13", + pin8: "VCC", + pin9: "CS0", + pin10: "MISO", + pin11: "GPIO9", + pin12: "GPIO10", + pin13: "MOSI", + pin14: "SCLK", + pin15: "GND", + pin16: "GPIO15", + pin17: "GPIO2", + pin18: "GPIO0", + pin19: "GPIO4", + pin20: "GPIO5", + pin21: "RXD", + pin22: "TXD", +} as const + +const uartPins = { + pin1: "RST", + pin2: "GPIO0", + pin3: "GPIO1", + pin4: "GND", + pin5: "DPLUS", + pin6: "DMINUS", + pin7: "REGIN", + pin8: "VDD", + pin9: "VIO", + pin10: "SUSPEND", + pin11: "SUSPEND_N", + pin12: "WAKEUP", + pin13: "RI", + pin14: "DCD", + pin15: "DTR", + pin16: "DSR", + pin17: "TXD", + pin18: "RXD", + pin19: "RTS", + pin20: "CTS", + pin21: "GPIO2", + pin22: "GPIO3", + pin23: "CHREN", + pin24: "NC", + pin25: "EP", +} as const + +const usbPins = { + pin1: "GND1", + pin2: "VBUS1", + pin3: "CC1", + pin4: "DP1", + pin5: "DM1", + pin6: "SBU1", + pin7: "SBU2", + pin8: "DM2", + pin9: "DP2", + pin10: "CC2", + pin11: "VBUS2", + pin12: "GND2", + pin13: "SHELL1", + pin14: "SHELL2", + pin15: "SHELL3", + pin16: "SHELL4", +} as const + +const Esp12F = () => ( + + {[1, 2, 3, 4, 5, 6, 7, 8].map((p, i) => ( + + + + ))} + {[15, 16, 17, 18, 19, 20, 21, 22].map((p, i) => ( + + + + ))} + {[9, 10, 11, 12, 13, 14].map((p, i) => ( + + + + ))} + + + } + /> +) + +export default () => ( + + + + + + + + + + + {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((p, i) => ( + + + + ))} + + + + + + + } + /> + + + + {[1, 2, 3, 4, 5, 6].map((p, i) => ( + + + + ))} + {[7, 8, 9, 10, 11, 12].map((p, i) => ( + + + + ))} + {[13, 14, 15, 16, 17, 18].map((p, i) => ( + + + + ))} + {[19, 20, 21, 22, 23, 24].map((p, i) => ( + + + + ))} + + + + } + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +) +import { Fragment } from "react" diff --git a/tests/repros/kicad-benchmark-four-sections.test.tsx b/tests/repros/kicad-benchmark-four-sections.test.tsx new file mode 100644 index 000000000..d8618667b --- /dev/null +++ b/tests/repros/kicad-benchmark-four-sections.test.tsx @@ -0,0 +1,23 @@ +import { expect, test } from "bun:test" +import { getTestFixture } from "tests/fixtures/get-test-fixture" +import KicadBenchmark from "./fixtures/kicad-benchmark-four-sections.fixture" + +test("kicad benchmark renders four schematic sections", async () => { + const { circuit } = getTestFixture() + + circuit.add() + await circuit.renderUntilSettled() + + const circuitJson = circuit.getCircuitJson() + const sectionDividers = circuitJson.filter( + (element) => element.type === "schematic_line", + ) + const sectionTitles = circuitJson.filter( + (element) => + element.type === "schematic_text" && element.text === "BOOT / STATUS", + ) + + expect(sectionDividers).toHaveLength(0) + expect(sectionTitles).toHaveLength(1) + expect(circuit).toMatchSchematicSnapshot(import.meta.path) +})