diff --git a/frontend/src/__tests__/__snapshots__/examples-netlist-snapshot.test.ts.snap b/frontend/src/__tests__/__snapshots__/examples-netlist-snapshot.test.ts.snap index 4edf4697..bab9cd80 100644 --- a/frontend/src/__tests__/__snapshots__/examples-netlist-snapshot.test.ts.snap +++ b/frontend/src/__tests__/__snapshots__/examples-netlist-snapshot.test.ts.snap @@ -1392,7 +1392,8 @@ exports[`netlist snapshot — circuits (40 examples) > nano-sensor-station 1`] = V_VCC_RAIL vcc_rail 0 DC 5 R_ntc_ntc vcc_rail n1 11441.484668193882 R_ntc_pull n1 0 10000 -R_autopull_n0 n0 0 100Meg +R_ldr_ldr vcc_rail n0 400000 +R_ldr_pull n0 0 10000 .op .end" `; @@ -1754,7 +1755,8 @@ R_autopull_n2 n2 0 100Meg exports[`netlist snapshot — circuits (40 examples) > photoresistor-light 1`] = ` "* Velxio circuit V_VCC_RAIL vcc_rail 0 DC 5 -R_autopull_n0 n0 0 100Meg +R_ldr_ldr vcc_rail n0 285714.28571428574 +R_ldr_pull n0 0 10000 .op .end" `; diff --git a/frontend/src/__tests__/component-to-spice.test.ts b/frontend/src/__tests__/component-to-spice.test.ts index 66b36b40..d0e6351a 100644 --- a/frontend/src/__tests__/component-to-spice.test.ts +++ b/frontend/src/__tests__/component-to-spice.test.ts @@ -97,6 +97,10 @@ const MINIMAL_FIXTURES: Record = { potentiometer: { pins: ['VCC', 'SIG', 'GND'], properties: { min: 0, max: 1023, value: 512 } }, 'ntc-temperature-sensor': { pins: ['VCC', 'OUT', 'GND'], properties: { temperature: 25 } }, photoresistor: { pins: ['VCC', 'AO', 'GND'], properties: { lux: 500 } }, + // Same physical part as `photoresistor`, exposed under the alias metadataId + // the components-metadata generator emits. The SPICE mapper for both is + // identical (componentToSpice.ts:MAPPERS['photoresistor-sensor'] = MAPPERS['photoresistor']). + 'photoresistor-sensor': { pins: ['VCC', 'AO', 'GND'], properties: { lux: 500 } }, 'instr-voltmeter': { pins: ['V+', 'V-'] }, 'instr-ammeter': { pins: ['A+', 'A-'] }, // Logic gates drive Y via a B-source. Drive inputs to VCC (high), observe