Make the audio row test fail when a row is the node itself
The fake nodes carried only id and name, so a projection that handed back the node passed every assertion. Giving one an object-valued audio property, as a live PwNode has, makes the deep comparison catch it. Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c9faea7c55
commit
92e1a27618
1 file changed
+3
-2
@@ -14,9 +14,10 @@ assert(audio.isAudioSource({ audio: {} }), 'audio detects nodes with audio as so
|
||||
assert(audio.isAudioSource({ type: 'Audio/Source' }), 'audio detects typed source nodes')
|
||||
|
||||
// A destroyed PwNode stays truthy but reads back no id, which is the shape the
|
||||
// third entry stands in for: it must not reach a Repeater row.
|
||||
// third entry stands in for: it must not reach a Repeater row. The first carries
|
||||
// an object like a live node's audio, so a row that is the node itself fails here.
|
||||
assertDeepEqual(
|
||||
audio.rowSnapshot([{ id: 0, name: 'alsa_output' }, { id: 42 }, {}, null]),
|
||||
audio.rowSnapshot([{ id: 0, name: 'alsa_output', audio: { volume: 1 } }, { id: 42 }, {}, null]),
|
||||
[{ id: 0, name: 'alsa_output' }, { id: 42, name: '' }],
|
||||
'audio projects nodes to primitive rows and drops nodes without an id'
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user