diff --git a/tests/components/normal-components/__snapshots__/resonator-default-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator-default-schematic.snap.svg deleted file mode 100644 index de605753a..000000000 --- a/tests/components/normal-components/__snapshots__/resonator-default-schematic.snap.svg +++ /dev/null @@ -1,17 +0,0 @@ --2,-1-2,0-2,1-1,-1-1,0-1,10,-10,00,11,-11,01,12,-12,02,1K4 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator-no-ground-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator-no-ground-schematic.snap.svg deleted file mode 100644 index 6fc732efb..000000000 --- a/tests/components/normal-components/__snapshots__/resonator-no-ground-schematic.snap.svg +++ /dev/null @@ -1,17 +0,0 @@ --2,-1-2,0-2,1-1,-1-1,0-1,10,-10,00,11,-11,01,12,-12,02,1K1 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator-single-ground-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator-single-ground-schematic.snap.svg deleted file mode 100644 index ec7f586ae..000000000 --- a/tests/components/normal-components/__snapshots__/resonator-single-ground-schematic.snap.svg +++ /dev/null @@ -1,17 +0,0 @@ --2,-2-2,-1-2,0-2,1-2,2-1,-2-1,-1-1,0-1,1-1,20,-20,-10,00,10,21,-21,-11,01,11,22,-22,-12,02,12,2K2 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator-two-ground-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator-two-ground-schematic.snap.svg deleted file mode 100644 index ae236e9bd..000000000 --- a/tests/components/normal-components/__snapshots__/resonator-two-ground-schematic.snap.svg +++ /dev/null @@ -1,17 +0,0 @@ --2,-2-2,-1-2,0-2,1-2,2-1,-2-1,-1-1,0-1,1-1,20,-20,-10,00,10,21,-21,-11,01,11,22,-22,-12,02,12,2K3 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-default-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-default-schematic.snap.svg deleted file mode 100644 index 6418a51fe..000000000 --- a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-default-schematic.snap.svg +++ /dev/null @@ -1,20 +0,0 @@ --2,-1-2,0-2,1-1,-1-1,0-1,10,-10,00,11,-11,01,12,-12,02,1K4 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-no-ground-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-no-ground-schematic.snap.svg deleted file mode 100644 index 85bf71977..000000000 --- a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-no-ground-schematic.snap.svg +++ /dev/null @@ -1,20 +0,0 @@ --2,-1-2,0-2,1-1,-1-1,0-1,10,-10,00,11,-11,01,12,-12,02,1K1 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-single-ground-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-single-ground-schematic.snap.svg deleted file mode 100644 index 81b5910c9..000000000 --- a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-single-ground-schematic.snap.svg +++ /dev/null @@ -1,20 +0,0 @@ --2,-2-2,-1-2,0-2,1-2,2-1,-2-1,-1-1,0-1,1-1,20,-20,-10,00,10,21,-21,-11,01,11,22,-22,-12,02,12,2K2 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-symbols-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-symbols-schematic.snap.svg new file mode 100644 index 000000000..0b9ec616b --- /dev/null +++ b/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-symbols-schematic.snap.svg @@ -0,0 +1,20 @@ +-2,-2-2,-1-2,0-2,1-2,2-2,3-2,4-2,5-1,-2-1,-1-1,0-1,1-1,2-1,3-1,4-1,50,-20,-10,00,10,20,30,40,51,-21,-11,01,11,21,31,41,52,-22,-12,02,12,22,32,42,53,-23,-13,03,13,23,33,43,54,-24,-14,04,14,24,34,44,55,-25,-15,05,15,25,35,45,56,-26,-16,06,16,26,36,46,5K1K2K3K4 \ No newline at end of file diff --git a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-two-ground-schematic.snap.svg b/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-two-ground-schematic.snap.svg deleted file mode 100644 index 9eb1be34d..000000000 --- a/tests/components/normal-components/__snapshots__/resonator.test.tsx-resonator-two-ground-schematic.snap.svg +++ /dev/null @@ -1,20 +0,0 @@ --2,-2-2,-1-2,0-2,1-2,2-1,-2-1,-1-1,0-1,1-1,20,-20,-10,00,10,21,-21,-11,01,11,22,-22,-12,02,12,2K3 \ No newline at end of file diff --git a/tests/components/normal-components/resonator.test.tsx b/tests/components/normal-components/resonator.test.tsx index 87c972f62..ee51314d0 100644 --- a/tests/components/normal-components/resonator.test.tsx +++ b/tests/components/normal-components/resonator.test.tsx @@ -1,71 +1,66 @@ import { it, expect, describe } from "bun:test" import { getTestFixture } from "tests/fixtures/get-test-fixture" -describe("Resonator Component", () => { - it("should render a resonator with no ground pins", async () => { +describe("Resonator symbol variants (single snapshot)", () => { + it("arranges all variants via schX/schY and renders once", async () => { const { circuit } = getTestFixture() - circuit.add( - - - , - ) - circuit.render() - expect(circuit).toMatchSchematicSnapshot( - import.meta.path + "-resonator-no-ground", - ) - }) - it("should render a resonator with single ground pin", async () => { - const { circuit } = getTestFixture() - circuit.add( - - - , - ) - circuit.render() - expect(circuit).toMatchSchematicSnapshot( - import.meta.path + "-resonator-single-ground", - ) - }) + const placements = [ + { + name: "K1", + frequency: "1MHz", + loadCapacitance: "20pF", + pinVariant: "no_ground" as const, + schX: 0, + schY: 0, + }, + { + name: "K2", + frequency: "16MHz", + loadCapacitance: "22pF", + pinVariant: "ground_pin" as const, + schX: 4, + schY: 0, + }, + { + name: "K3", + frequency: "32MHz", + loadCapacitance: "18pF", + pinVariant: "two_ground_pins" as const, + schX: 0, + schY: 3, + }, + { + // default (no pinVariant) + name: "K4", + frequency: "8MHz", + loadCapacitance: "15pF", + pinVariant: undefined, + schX: 4, + schY: 3, + }, + ] - it("should render a resonator with two ground pins", async () => { - const { circuit } = getTestFixture() circuit.add( - + {placements.map((p) => ( + + ))} , ) - circuit.render() - expect(circuit).toMatchSchematicSnapshot( - import.meta.path + "-resonator-two-ground", - ) - }) - it("should render a resonator without pinVariant specified", async () => { - const { circuit } = getTestFixture() - circuit.add( - - - , - ) circuit.render() + expect(circuit).toMatchSchematicSnapshot( - import.meta.path + "-resonator-default", + import.meta.path + "-resonator-symbols", ) }) })