chain:
  '#group':
    - label: MUST create a single injectable
      instructions:
        - [call, prop, system_path, systems/1]
        - [expect, props, system_path, systems/1]
    - label: MUST link a single dependent
      instructions:
        - [set, /systems/1/setup/name, System 1]
        - [call, prop, system_path, systems/1]
        - [call, link, system_name, :system_path/setup/name]
        - [expect, links, system_name, System 1]
    - label: MUST update a single link
      instructions:
        - [set, /systems/1/setup/name, System 1]
        - [call, prop, system_path, systems/1]
        - [expect, props, system_path, systems/1]
        - [call, prop, system_path, systems/2]
        - [expect, props, system_path, systems/2]
    - label: MUST update dependents
      instructions:
        - [set, /systems/1/setup/name, System 1]
        - [set, /systems/2/setup/name, System 2]
        - [call, prop, system_path, systems/1]
        - [call, link, system_name, :system_path/setup/name]
        - [expect, links, system_name, System 1]
        - [call, prop, system_path, systems/2]
        - [expect, links, system_name, System 2]
    - label: MUST create multiple links
      instructions:
        - [set, /setup/components/1/sources/1/name, Apple TV]
        - [call, prop, source_path, components/1/sources/1]
        - [call, link, source_name, setup/:source_path/name]
        - [expect, props, source_path, components/1/sources/1]
        - [expect, links, source_name, Apple TV]
    - label: MUST update dependants
      instructions:
        - [set, /setup/components/1/sources/1/name, Apple TV]
        - [set, /setup/components/2/sources/1/name, Kaleidescape]
        - [call, prop, source_path, components/1/sources/1]
        - [call, link, source_name, setup/:source_path/name]
        - [expect, props, source_path, components/1/sources/1]
        - [expect, links, source_name, Apple TV]
        - [call, prop, source_path, components/2/sources/1]
        - [expect, links, source_name, Kaleidescape]
    - label: MUST update dependant when updated
      instructions:
        - [set, /setup/rooms/1/source_path, /components/1/sources/1]
        - [set, /setup/components/1/sources/1/name, Apple TV]
        - [set, /setup/components/2/sources/1/name, Kaleidescape]
        - [call, link, source_path, setup/rooms/1/source_path]
        - [call, link, source_name, setup/:source_path/name]
        - [expect, links, source_path, /components/1/sources/1]
        - [expect, links, source_name, Apple TV]
        - [set, /setup/rooms/1/source_path, /components/2/sources/1]
        - [expect, links, source_path, /components/2/sources/1]
        - [expect, links, source_name, Kaleidescape]
    - label: MUST update relink
      instructions:
        - [set, /setup/rooms/1/source_path, /components/1/sources/1]
        - [set, /setup/components/1/sources/1/name, Kaleidescape]
        - [call, link, source_path, setup/rooms/1/source_path]
        - [call, link, source_name, setup/:source_path/name]
        - [spy, callback]
        - [expect, spy, false, callback]
        - [call, link, source_name, setup/:source_path/name, spy:callback, true]
        - [expect, spy, true, callback]
        - [expect, links, source_name, Kaleidescape]
    - label: MUST evaluate function in pipe
      instructions:
        - [set, /setup/components/1/sources/1/name, Apple TV]
        - [set, /setup/components/2/sources/1/name, Kaleidescape]
        - [call, prop, source_path, components/1/sources/1]
        - [call, pipe, source_trunk_path, source_path, "eval:value => { return `/${value.split('/').slice(0, 2).join('/')}` }"]
        - [expect, pipes, source_trunk_path, /components/1]
        - [call, pipe, source_trunk_path_length, source_trunk_path, length]
        - [expect, pipes, source_trunk_path_length, 13]
    - label: MUST call callbacks with default string
      instructions:
        - [set, /setup/components/1/sources/1/name, Apple TV]
        - [spy, one]
        - [call, link, source_name, setup/components/1/sources/1/name, spy:one, { type: string, value: 'default' }]
        - [expect, spy, [0, Apple TV], one]
        - [set, /setup/components/1/sources/1/name, null]
        - [expect, spy, [1, default], one]
    - label: MUST call callbacks with default number
      instructions:
        - [set, /setup/components/1/speakers/1/volume, 50]
        - [spy, one]
        - [call, link, source_name, setup/components/1/speakers/1/volume, spy:one, { type: number, value: 0 }]
        - [expect, spy, [0, 50], one]
        - [set, /setup/components/1/speakers/1/volume, null]
        - [expect, spy, [1, 0], one]
    - label: MUST call callbacks with default array
      instructions:
        - [set, /setup/components/1/speakers/1/source_paths, [/components/2/sources/1]]
        - [spy, one]
        - [call, link, source_name, setup/components/1/speakers/1/source_paths, spy:one, { type: array, value: [] }]
        - [expect, spy, [0, [/components/2/sources/1]], one]
        - [set, /setup/components/1/speakers/1/source_paths, null]
        - [expect, spy, [1, []], one]