-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathgroup-schematic-box.test.tsx
More file actions
42 lines (38 loc) · 1.08 KB
/
group-schematic-box.test.tsx
File metadata and controls
42 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { expect, test } from "bun:test"
import { getTestFixture } from "tests/fixtures/get-test-fixture"
test("group schematic box", () => {
const { circuit } = getTestFixture()
circuit.add(
<board routingDisabled>
<group name="G1" showAsSchematicBox>
<resistor name="R1" resistance="1k" footprint="0402" />
<capacitor name="C1" capacitance="1uF" footprint="0402" />
</group>
</board>,
)
circuit.render()
const schematic_group = circuit.db.schematic_group
.list()
.filter((g) => g.name === "G1")
expect(schematic_group).toMatchInlineSnapshot(`
[
{
"center": {
"x": 0,
"y": 0,
},
"height": 0,
"is_subcircuit": undefined,
"name": "G1",
"schematic_component_ids": [],
"schematic_group_id": "schematic_group_0",
"show_as_schematic_box": true,
"source_group_id": "source_group_0",
"subcircuit_id": null,
"type": "schematic_group",
"width": 0,
},
]
`)
expect(circuit).toMatchSchematicSnapshot(import.meta.path)
})