Workers P2: Sichtprüfung im Browser – Schilder über den Figuren, Raumtitel über den Möbeln, Zoomknöpfe unten, Abstand der Meldung
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d67f8cc471
commit
820ccd510d
9 files changed
+122
-21
No files matched your search
@@ -297,3 +297,40 @@ test('grauer Raum: Teamfarbton bleibt, das Schild ersetzt den Titel (kein Platz
|
||||
assert.equal(grey.texts.filter((x) => x.text === SIGN).length, 1)
|
||||
assert.equal(normal.texts.filter((x) => x.text === SIGN).length, 0)
|
||||
})
|
||||
|
||||
test('Schilder: drawRooms mit signs: false lässt sie aus (Grautönung bleibt), drawSigns zeichnet genau diese Schilder an dieselbe Stelle', () => {
|
||||
const look = looks({ greyRooms: new Set(['kleinanzeigen', 'portale']) })
|
||||
const withSigns = draw(look)
|
||||
const m = makeCtx()
|
||||
R.drawRooms(m.ctx, layout, 1, look, { signs: false })
|
||||
assert.equal(m.texts.filter((x) => x.text === SIGN).length, 0)
|
||||
assert.equal(m.rects.length < withSigns.rects.length, true)
|
||||
assert.ok(m.alphas.includes(0.45), 'die Grautönung gehört weiter zum Raum')
|
||||
assert.deepEqual(m.texts.filter((x) => x.text !== SIGN).map((x) => x.text), withSigns.texts.filter((x) => x.text !== SIGN).map((x) => x.text))
|
||||
const s = makeCtx()
|
||||
R.drawSigns(s.ctx, layout, look)
|
||||
assert.deepEqual(s.texts.map((x) => x.text), [SIGN, SIGN])
|
||||
assert.deepEqual(s.texts.map((x) => [x.x, x.y]), withSigns.texts.filter((x) => x.text === SIGN).map((x) => [x.x, x.y]))
|
||||
const none = makeCtx()
|
||||
R.drawSigns(none.ctx, layout, R.createLook())
|
||||
assert.equal(none.rects.length + none.texts.length, 0)
|
||||
const noWorker = makeCtx()
|
||||
R.drawSigns(noWorker.ctx, layout, looks({ greyRooms: new Set(['pult', 'tresor']) })) // Räume ohne Worker werden nie grau
|
||||
assert.equal(noWorker.texts.length, 0)
|
||||
})
|
||||
|
||||
test('Raumtitel: über den Möbeln gezeichnet (ein Monitor deckt sie nicht zu) und mit hellem Rand', () => {
|
||||
const floor = layout.floors.find((f) => f.id === 'gespraeche')
|
||||
const room = floor.rooms.find((r) => r.id === 'mail')
|
||||
const m = makeCtx()
|
||||
R.drawRooms(m.ctx, { ...layout, floors: [{ ...floor, rooms: [room] }] }, 1, R.createLook())
|
||||
assert.equal(m.strokes.length, 1)
|
||||
assert.equal(m.strokes[0].text, room.title)
|
||||
assert.ok(m.strokes[0].style.startsWith('rgba(255, 255, 255'))
|
||||
assert.equal(m.strokes[0].rects, m.rects.length, 'nach dem Titel kommt keine Fläche mehr: Möbel, Tisch und Monitor liegen darunter')
|
||||
assert.ok(m.rects.length > 20)
|
||||
assert.equal(m.texts.filter((x) => x.text === room.title).length, 1)
|
||||
const grey = makeCtx()
|
||||
R.drawRooms(grey.ctx, { ...layout, floors: [{ ...floor, rooms: [{ ...room, id: 'kleinanzeigen' }] }] }, 1, looks({ greyRooms: new Set(['kleinanzeigen']) }))
|
||||
assert.equal(grey.strokes.length, 0, 'im grauen Raum steht kein Titel')
|
||||
})
|
||||
Reference in new issue
Block a user