-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display value for units of 100 (#592)
* fix: display value for 100uF * formatbot: Automatically format code * test update --------- Co-authored-by: tscircuitbot <[email protected]>
- Loading branch information
1 parent
c51a5ee
commit 0390dc3
Showing
6 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...l-components/__snapshots__/chip-port-without-portarrangement-schematic.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...imitive-components/__snapshots__/schematic-trace-obstacles-1-schematic.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...es/__snapshots__/example7-voltage-regulator-with-connections-schematic.snap.svg
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
35
tests/examples/example17-display-capacitance-value.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
} | ||
`) | ||
}) |