Add drag-to-trash exhibit disposal

This commit is contained in:
2026-08-14 19:37:43 +02:00
parent 18705fe55f
commit 703b9652c9
5 changed files with 103 additions and 4 deletions
+19
View File
@@ -43,6 +43,25 @@ test('move, folder expansion, empty-board pan, desktop wheel zoom, mobile pinch,
await expect(page.locator('.brief-panel')).not.toHaveClass(/\bminimized\b/)
await page.getByRole('button', { name: 'BEGIN INVESTIGATION', exact: true }).click()
page.once('dialog', dialog => dialog.accept('Disposable working theory'))
await waitForSave(page, () => page.getByRole('button', { name: 'NEW NOTE', exact: true }).click())
const note = page.locator('.evidence-card.note').filter({ hasText: 'Disposable working theory' })
const trash = page.locator('.board-trash')
await expect(note).toBeVisible()
const noteBox = await note.boundingBox(), trashBox = await trash.boundingBox()
if (!noteBox || !trashBox) throw new Error('Note or exhibit trash is not visible')
const noteDragStart = { x: noteBox.x + noteBox.width / 2, y: noteBox.y + noteBox.height / 2 }
const discardSave = page.waitForResponse(candidate => candidate.request().method() === 'PUT' && candidate.url().includes('/api/levels/') && candidate.ok())
await page.mouse.move(noteDragStart.x, noteDragStart.y)
await page.mouse.down()
await page.mouse.move(trashBox.x + trashBox.width / 2, trashBox.y + trashBox.height / 2, { steps: 8 })
await expect(trash).toHaveClass(/\bactive\b/)
await page.mouse.up()
await discardSave
await expect(note).toHaveCount(0)
await page.reload()
await expect(page.locator('.evidence-card.note')).toHaveCount(0)
const folder = page.locator('[data-temporal-id="widget:11111111-1111-4111-8111-111111111111"]')
const file = page.locator('[data-temporal-id="file:contains:11111111-1111-4111-8111-111111111111:22222222-2222-4222-8222-222222222222"]')
const board = page.locator('.board')