feat: add tagged red thread connections
This commit is contained in:
@@ -64,11 +64,28 @@ test('a cloned Glass Harbor level can be solved without modifying its template',
|
||||
page.once('dialog', dialog => dialog.accept('The redirection memorandum was written after the crate had already moved.'))
|
||||
await waitForSave(page, () => page.getByRole('button', { name: 'NEW NOTE', exact: true }).click())
|
||||
|
||||
const mara = page.locator('.evidence-card.party').filter({ has: page.getByRole('heading', { name: 'Mara Voss', exact: true }) })
|
||||
const elias = page.locator('.evidence-card.party').filter({ has: page.getByRole('heading', { name: 'Elias Vale', exact: true }) })
|
||||
const movement = page.locator('.evidence-card.folder').filter({ hasText: 'MOVEMENT RECORDS' })
|
||||
await mara.click()
|
||||
await page.getByRole('button', { name: 'CONNECT', exact: true }).click()
|
||||
await waitForSave(page, () => movement.click())
|
||||
await waitForSave(page, () => page.getByRole('button', { name: 'Zoom out', exact: true }).click())
|
||||
await waitForSave(page, () => movement.getByRole('button', { name: 'OPEN', exact: true }).click())
|
||||
const manifest = page.locator('.source-file-widget.open').filter({ hasText: 'Carrier Dispatch Manifest' })
|
||||
await elias.click()
|
||||
await page.getByRole('button', { name: 'Red thread', exact: true }).click()
|
||||
const boardBox = await page.locator('.board-viewport').boundingBox()
|
||||
if (!boardBox) throw new Error('Board is not visible')
|
||||
await page.mouse.move(boardBox.x + boardBox.width / 2, boardBox.y + boardBox.height / 2)
|
||||
await expect(page.locator('.connections .thread-preview path')).toBeVisible()
|
||||
const manifestBox = await manifest.boundingBox()
|
||||
if (!manifestBox) throw new Error('Carrier Dispatch Manifest is not visible')
|
||||
await page.mouse.move(manifestBox.x + manifestBox.width / 2, manifestBox.y + manifestBox.height / 2)
|
||||
await manifest.click()
|
||||
const threadEditor = page.locator('.thread-editor')
|
||||
await expect(threadEditor.getByText('Elias Vale', { exact: true })).toBeVisible()
|
||||
await expect(threadEditor.getByText('Carrier Dispatch Manifest · H&F 14', { exact: true })).toBeVisible()
|
||||
await page.getByLabel('Thread tag').fill('Proof Elias is the driver')
|
||||
await page.getByRole('slider', { name: 'Thread tightness', exact: true }).fill('85')
|
||||
await waitForSave(page, () => page.getByRole('button', { name: 'ADD TAG & TIGHTEN', exact: true }).click())
|
||||
await expect(page.locator('.connections g.tightening path')).toBeVisible()
|
||||
|
||||
await page.reload()
|
||||
await expect(page.locator('.evidence-card.party')).toHaveCount(6)
|
||||
@@ -77,6 +94,10 @@ test('a cloned Glass Harbor level can be solved without modifying its template',
|
||||
await expect(page.locator('.story-strip')).toContainText('CO-771 was diverted to Warehouse 3')
|
||||
await expect(page.locator('.event-support-lines line')).toHaveCount(6)
|
||||
await expect(page.locator('.connections path')).toHaveCount(1)
|
||||
await expect(page.locator('.thread-tag')).toContainText('Proof Elias is the driver')
|
||||
|
||||
const solved = await (await request.get(`/api/levels/${playable.id}`)).json()
|
||||
expect(solved.connections).toContainEqual(expect.objectContaining({ label: 'Proof Elias is the driver', tightness: 85 }))
|
||||
|
||||
const template = await (await request.get('/api/templates')).json() as { slug: string; currentVersion: number }[]
|
||||
expect(template).toContainEqual(expect.objectContaining({ slug: 'glass-harbor', currentVersion: 1 }))
|
||||
|
||||
Reference in New Issue
Block a user