test: align photoresistor-sensor fixtures + snapshots with 603b791 alias
Three failures introduced by 603b791 (which added
MAPPERS['photoresistor-sensor'] = MAPPERS['photoresistor'] so the
metadata-id 'photoresistor-sensor' resolves to a SPICE mapper):
- component-to-spice.test.ts "every mapped metadataId has a test fixture"
flagged photoresistor-sensor as missing. Added a fixture entry that
mirrors the photoresistor one — the part is electrically identical.
- examples-netlist-snapshot.test.ts > photoresistor-light and
> nano-sensor-station snapshots now contain R_ldr_ldr + R_ldr_pull
cards (correct LDR + 10k pull) instead of the previous
R_autopull_n0 100M stub. This is the intended behaviour change:
before the alias the LDR was unmapped and the netlist autopulled the
net to ground with a 100M dummy; after the alias the SPICE deck
carries the real divider topology. Regenerated only these two
snapshot entries (vitest -u on the single file).
No production code changes.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
603b791daa
commit
95a60e1d01
|
|
@ -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"
|
||||
`;
|
||||
|
|
|
|||
|
|
@ -97,6 +97,10 @@ const MINIMAL_FIXTURES: Record<string, Fixture> = {
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue