This commit is contained in:
2026-10-19 00:57:56 +07:00
parent 5635b8b5b1
commit 7fa0004ab9
7 changed files with 20 additions and 15 deletions
+4 -1
View File
@@ -24,7 +24,8 @@ module.exports = async ({ evaluate, poll }) => {
if (request.url === '/api/games/7/music') return send({ gamePlaylistId: 1, playlists: [{ ID: 1, name: 'Музыка', tracks:
Array.from({ length: 13 }, (_, index) => ({ ID: index + 1, name: `Трек ${index}`, filename: `track-${index}.wav` })),
}] })
if (request.url === '/api/scenarios/23') return send({ scenario: { ID: 23, image: 'cover.png', story: { background: 'background.png', introduction: { audio: 'intro.wav' } } } }, scenarioError ? 403 : 200)
if (request.url === '/api/scenarios/23') return send({ scenario: { ID: 23, image: 'cover.png' } })
if (request.url === '/api/scenarios/23/full') return send({ scenario: { ID: 23, image: 'cover.png', story: { background: 'background.png', introduction: { audio: 'intro.wav' } } } }, scenarioError ? 403 : 200)
if (request.url.startsWith('/api/files/')) {
response.writeHead(200, { 'Content-Type': request.url.endsWith('.png') ? 'image/png' : 'audio/wav' })
response.end(request.url.endsWith('.png') ? image : soundCheckWav)
@@ -42,6 +43,8 @@ module.exports = async ({ evaluate, poll }) => {
await evaluate('window.screenBridge.onlineAction({ action: "select-game", gameId: 7 })')
const result = await evaluate('window.screenBridge.onlineState()')
assert.equal(result.materials.length, 16)
assert.ok(requests.includes('/api/scenarios/23/full'))
assert.ok(!requests.includes('/api/scenarios/23'))
assert.ok(result.materials.every((m) => m.status === 'ready'))
assert.ok(result.materials.some((m) => m.usages.some((u) => u.name === 'Фон')))
assert.ok(result.materials.some((m) => m.usages.some((u) => u.name === 'Вступление')))