Add E2E test for fill color change (#100)
The fill color bug was caused by a missing `ref` import in FillPicker.vue, introduced in37da83aand fixed in3b32b4d. Add a regression test that opens the color picker, clicks the color area, and verifies the node's fill color updates.
This commit is contained in:
parent
7c63fc3b22
commit
00da8bde1b
|
|
@ -87,6 +87,31 @@ test('fill item shows color swatch', async () => {
|
|||
await expect(swatch).toBeVisible()
|
||||
})
|
||||
|
||||
test('clicking color area changes fill color', async () => {
|
||||
const id = await getSelectedId()
|
||||
const before = await getNode(id!)
|
||||
|
||||
const swatch = fillSection().locator('[data-test-id="fill-picker-swatch"]').first()
|
||||
await swatch.click()
|
||||
|
||||
const colorArea = page.locator('.cursor-crosshair').first()
|
||||
await expect(colorArea).toBeVisible({ timeout: 5000 })
|
||||
|
||||
const box = await colorArea.boundingBox()
|
||||
await page.mouse.click(box!.x + box!.width - 10, box!.y + 10)
|
||||
await canvas.waitForRender()
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
const after = await getNode(id!)
|
||||
const c1 = before!.fills[0].color
|
||||
const c2 = after!.fills[0].color
|
||||
expect(c1.r !== c2.r || c1.g !== c2.g || c1.b !== c2.b).toBe(true)
|
||||
|
||||
// Close popover — click the swatch again to toggle it off
|
||||
await swatch.click()
|
||||
await canvas.waitForRender()
|
||||
})
|
||||
|
||||
test('adding a stroke creates stroke section item', async () => {
|
||||
const addBtn = strokeSection().locator('[data-test-id="stroke-section-add"]')
|
||||
await addBtn.click()
|
||||
|
|
|
|||
Loading…
Reference in a new issue