Kaynağa Gözat

chore: add and fix e2e tests

Konstantinos Kaloutas 2 yıl önce
ebeveyn
işleme
f530927062
1 değiştirilmiş dosya ile 14 ekleme ve 1 silme
  1. 14 1
      e2e-tests/whiteboards.spec.ts

+ 14 - 1
e2e-tests/whiteboards.spec.ts

@@ -163,6 +163,7 @@ test('convert the first rectangle to ellipse', async ({ page }) => {
   await page.keyboard.press('Escape')
   await page.waitForTimeout(1000)
   await page.click('.logseq-tldraw .tl-box-container:first-of-type')
+  await page.mouse.move(0, 0)  // move mouse to trigger a rerender of the context bar
   await page.click('.tl-context-bar .tl-geometry-tools-pane-anchor')
   await page.click('.tl-context-bar .tl-geometry-toolbar [data-tool=ellipse]')
 
@@ -170,6 +171,19 @@ test('convert the first rectangle to ellipse', async ({ page }) => {
   await expect(page.locator('.logseq-tldraw .tl-box-container')).toHaveCount(1)
 })
 
+test('change the color of the ellipse', async ({ page }) => {
+  await page.click('.tl-context-bar .tl-color-bg')
+  await page.click('.tl-context-bar .tl-color-palette .bg-red-500')
+
+  await expect(page.locator('.logseq-tldraw .tl-ellipse-container ellipse:last-of-type')).toHaveAttribute('fill', 'var(--ls-wb-background-color-red)')
+})
+
+test('undo the color switch', async ({ page }) => {
+  await page.keyboard.press(modKey + '+z')
+
+  await expect(page.locator('.logseq-tldraw .tl-ellipse-container ellipse:last-of-type')).toHaveAttribute('fill', 'var(--ls-wb-background-color-default)')
+})
+
 test('undo the conversion', async ({ page }) => {
   await page.keyboard.press(modKey + '+z')
 
@@ -177,7 +191,6 @@ test('undo the conversion', async ({ page }) => {
   await expect(page.locator('.logseq-tldraw .tl-ellipse-container')).toHaveCount(0)
 })
 
-
 test('locked elements should not be removed', async ({ page }) => {
   await page.keyboard.press('Escape')
   await page.waitForTimeout(1000)