Skip to content

Commit

Permalink
fix: display value for units of 100 (#592)
Browse files Browse the repository at this point in the history
* fix: display value for 100uF

* formatbot: Automatically format code

* test update

---------

Co-authored-by: tscircuitbot <[email protected]>
  • Loading branch information
imrishabh18 and tscircuitbot authored Jan 31, 2025
1 parent c51a5ee commit 0390dc3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
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 @@ -59,7 +59,7 @@
"@tscircuit/soup-util": "^0.0.41",
"circuit-json": "^0.0.135",
"circuit-json-to-connectivity-map": "^0.0.17",
"format-si-unit": "^0.0.2",
"format-si-unit": "^0.0.3",
"nanoid": "^5.0.7",
"performance-now": "^2.1.0",
"react-reconciler": "^0.31.0",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions tests/examples/example17-display-capacitance-value.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { test, expect } from "bun:test"
import { convertCircuitJsonToSchematicSvg } from "circuit-to-svg"
import { getTestFixture } from "tests/fixtures/get-test-fixture"

test("schematic capacitor symbol", () => {
const { circuit } = getTestFixture()

circuit.add(
<board width="22mm" height="22mm">
<capacitor
name="C1"
capacitance="100uF"
footprint="0402"
schX={3}
schY={0}
/>
</board>,
)

circuit.render()

expect(circuit.db.source_component.list()[0]).toMatchInlineSnapshot(`
{
"capacitance": 0.0001,
"display_capacitance": "100µF",
"ftype": "simple_capacitor",
"manufacturer_part_number": undefined,
"max_decoupling_trace_length": undefined,
"name": "C1",
"source_component_id": "source_component_0",
"supplier_part_numbers": undefined,
"type": "source_component",
}
`)
})

0 comments on commit 0390dc3

Please sign in to comment.