up
This commit is contained in:
@@ -14,6 +14,7 @@ module.exports = async function onlineSmoke({
|
||||
}) {
|
||||
let gamesCalls = 0
|
||||
let varyGames = false
|
||||
let invalidStory = false
|
||||
let version = 1
|
||||
let offline = false
|
||||
let polls = 0
|
||||
@@ -63,7 +64,7 @@ module.exports = async function onlineSmoke({
|
||||
game: {
|
||||
ID: 6,
|
||||
name: 'HTTP smoke',
|
||||
scenario: { story: { introduction: { audio: 'intro.wav' } } },
|
||||
scenario: { story: invalidStory ? null : { introduction: { audio: 'intro.wav' } } },
|
||||
},
|
||||
})
|
||||
if (path === '/api/games/6/screen-plan') {
|
||||
@@ -250,6 +251,28 @@ module.exports = async function onlineSmoke({
|
||||
'control target stays on local package despite server game selection',
|
||||
)
|
||||
assert.notEqual(selectedBeforeDownload, 'HTTP smoke')
|
||||
invalidStory = true
|
||||
await assert.rejects(act({ action: 'connect', gameId: 6 }), /game.scenario.story/)
|
||||
await poll(
|
||||
() =>
|
||||
evaluate(
|
||||
`document.querySelector('[data-testid="connection-error"]')?.textContent.includes('game.scenario.story')`,
|
||||
),
|
||||
'detailed API error shown',
|
||||
)
|
||||
const errorText = await evaluate(
|
||||
`document.querySelector('[data-testid="connection-error"]').textContent`,
|
||||
)
|
||||
assert.ok(errorText.includes('Описание игры · GET /api/games/6'))
|
||||
assert.ok(errorText.includes('получено null'))
|
||||
assert.ok(!errorText.includes('TEST-ACCESS'))
|
||||
assert.equal(
|
||||
await evaluate(
|
||||
`getComputedStyle(document.querySelector('[data-testid="connection-error"]')).overflowWrap`,
|
||||
),
|
||||
'anywhere',
|
||||
)
|
||||
invalidStory = false
|
||||
await act({ action: 'connect', gameId: 6 })
|
||||
const packages = await evaluate('window.screenBridge.packages()')
|
||||
const pkg = packages.find((p) => p.name === 'HTTP smoke')
|
||||
|
||||
Reference in New Issue
Block a user