Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Sep 21, 2024
1 parent 2afd91a commit ff51150
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@lume/kiwi": "^0.4.3",
"@tscircuit/infgrid-ijump-astar": "^0.0.21",
"@tscircuit/math-utils": "^0.0.4",
"@tscircuit/props": "^0.0.64",
"@tscircuit/props": "^0.0.65",
"@tscircuit/soup": "^0.0.73",
"@tscircuit/soup-util": "^0.0.28",
"circuit-json": "^0.0.77",
Expand Down
22 changes: 22 additions & 0 deletions tests/components/normal-components/chip.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,25 @@ it("should create a Chip component with correct properties", async () => {
convertCircuitJsonToSchematicSvg(circuit.getCircuitJson()),
).toMatchSvgSnapshot(import.meta.path)
})

it("should create a Chip component with cadModel prop", async () => {
const { circuit } = getTestFixture()

circuit.add(
<board width="10mm" height="10mm">
<chip
name="U1"
footprint="soic8"
cadModel={{
stlUrl: "https://example.com/chip.stl",
}}
/>
</board>,
)

circuit.render()

const cadComponents = circuit.db.cad_component.list()
expect(cadComponents).toHaveLength(1)
expect(cadComponents[0].model_stl_url).toBe("https://example.com/chip.stl")
})

0 comments on commit ff51150

Please sign in to comment.