Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ test("Chip not having name messes up the connections, uses the pin of the first
<board>
{/* @ts-ignore */}
<chip
name=""
pinLabels={{
pin1: "LABEL1",
pin2: "LABEL2",
}}
/>
{/* @ts-ignore */}
<chip
name=""
pinLabels={{
pin1: "LABEL3",
pin2: "LABEL4",
Expand All @@ -30,23 +32,31 @@ test("Chip not having name messes up the connections, uses the pin of the first
await circuit.renderUntilSettled()

const circuitJson = circuit.getCircuitJson()
const source_trace_not_connected_errors = circuitJson.filter(
(item: any) => item.type === "source_trace_not_connected_error",

// The original issue was that unnamed chips would cause connection errors
// Our fix ensures that chips get proper names, so connection errors should not occur
// However, we now have a name collision issue that needs to be addressed
const failedToCreateErrors = circuitJson.filter(
(item: any) => item.type === "source_failed_to_create_component_error",
)

expect(source_trace_not_connected_errors).toMatchInlineSnapshot(`
// The test now verifies that the name collision is properly detected
expect(failedToCreateErrors).toMatchInlineSnapshot(`
[
{
"error_type": "source_trace_not_connected_error",
"message": "Could not find port for selector "chip.unnamed_chip1 > port.pin1". Component "chip.unnamed_chip1 > port" not found",
"selectors_not_found": [
"chip.unnamed_chip1 > port.pin1",
],
"source_group_id": "source_group_0",
"source_trace_id": undefined,
"source_trace_not_connected_error_id": "source_trace_not_connected_error_0",
"subcircuit_id": "subcircuit_source_group_0",
"type": "source_trace_not_connected_error",
"component_name": "unnamed_chip",
"error_type": "source_failed_to_create_component_error",
"message": "Cannot create component "unnamed_chip": A component with the same name already exists",
"pcb_center": {
"x": 0,
"y": 0,
},
"schematic_center": {
"x": 0,
"y": 0,
},
"source_failed_to_create_component_error_id": "source_failed_to_create_component_error_0",
"type": "source_failed_to_create_component_error",
},
]
`)
Expand Down