-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #268 from ShiboSoftwareDev/main
Added capacitor, inductor, diode and led schRotation support
- Loading branch information
Showing
12 changed files
with
90 additions
and
96 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
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
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
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
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
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
tests/components/normal-components/__snapshots__/inductor-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.
12 changes: 12 additions & 0 deletions
12
...omponents/normal-components/__snapshots__/rotated-components-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.
12 changes: 0 additions & 12 deletions
12
.../components/normal-components/__snapshots__/rotated-resistor-schematic.snap.svg
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
tests/components/normal-components/rotated-components.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,48 @@ | ||
import { test, expect } from "bun:test" | ||
import { getTestFixture } from "tests/fixtures/get-test-fixture" | ||
|
||
test("rotated resistor/diode/inductor/led/capacitor schematic", () => { | ||
const { circuit } = getTestFixture() | ||
|
||
circuit.add( | ||
<board width="10mm" height="10mm"> | ||
<resistor | ||
name="R1" | ||
schY={0} | ||
schX={0} | ||
resistance="10k" | ||
schRotation="90deg" | ||
/> | ||
<led name="L1" schY={0} schX={2} schRotation="90deg" /> | ||
<inductor | ||
name="I1" | ||
schY={0} | ||
schX={4} | ||
inductance="10k" | ||
schRotation="90deg" | ||
/> | ||
<capacitor | ||
name="C1" | ||
schY={0} | ||
schX={6} | ||
capacitance="10k" | ||
schRotation="90deg" | ||
/> | ||
<diode name="D1" schY={0} schX={8} schRotation="90deg" /> | ||
</board>, | ||
) | ||
|
||
circuit.render() | ||
|
||
const symbolNames = circuit.db.schematic_component | ||
.list() | ||
.map((elm) => elm.symbol_name) | ||
|
||
expect(symbolNames.includes("capacitor_vert")).toBeTruthy() | ||
expect(symbolNames.includes("inductor_vert")).toBeTruthy() | ||
expect(symbolNames.includes("led_vert")).toBeTruthy() | ||
expect(symbolNames.includes("boxresistor_vert")).toBeTruthy() | ||
expect(symbolNames.includes("diode_vert")).toBeTruthy() | ||
|
||
expect(circuit).toMatchSchematicSnapshot(import.meta.path) | ||
}) |
20 changes: 0 additions & 20 deletions
20
tests/components/normal-components/rotated-resistor.test.tsx
This file was deleted.
Oops, something went wrong.