This commit is contained in:
2026-10-17 22:35:50 +07:00
parent 688d900cdc
commit beb8ca8f16
8 changed files with 107 additions and 7 deletions
+49
View File
@@ -415,6 +415,55 @@ test('музыкальная громкость не возвращает ста
)
})
test('перестановка прежних треков останавливает музыку до повторной подготовки', async (t) => {
const f = await fixture(t)
await f.prepare()
f.controller.output(true)
send(f.controller, { action: 'play', channel: 'music' })
const previous = parseRemote({ music: objectMusic(1) })
const next = parseRemote({
music: { ...objectMusic(2), playlist: { ID: 1, tracks: [{ ID: 2 }, { ID: 1 }] } },
})
assert.throws(() => applyRemote(f.controller, previous, next), /Музыка изменилась/)
assert.equal(f.controller.state.channels.music.desired, 'stopped')
assert.deepEqual(f.controller.state.catalog.playlists[0]!.tracks.map((track) => track.id), [1, 2])
})
test('назначение звука восстанавливается после обрыва и открытия окна без повтора команд', async (t) => {
const f = await fixture(t)
await f.prepare()
f.controller.output(true)
await f.online.poll()
assert.equal(f.controller.state.muted, false)
send(f.controller, { action: 'mute', enabled: true })
f.model.offline = true
await f.online.poll()
f.model.offline = false
await f.online.poll()
assert.equal(f.controller.state.muted, true)
send(f.controller, { action: 'mute', enabled: false })
f.model.offline = true
await f.online.poll()
f.model.remote.soundEnabled = false
f.model.offline = false
await f.online.poll()
await f.online.poll()
assert.equal(f.controller.state.muted, true)
assert.equal(f.controller.state.channels.main.desired, 'stopped')
await f.online.act({ action: 'sound' })
f.model.remote.soundEnabled = true
await f.online.poll()
assert.equal(f.controller.state.muted, false)
f.controller.output(false)
f.controller.output(true)
f.model.remote.soundEnabled = false
await f.online.poll()
assert.equal(f.controller.state.muted, true)
assert.equal(f.controller.state.channels.main.desired, 'stopped')
})
test('истечение JWT не обрывает показ и оставляет доступным повторный вход', async (t) => {
const f = await fixture(t)
await f.prepare()