Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

fix e2e for the hugging recorder pill and waits that skip never-ending animations

Eric Brownroutf1e8a3c0993d
diff --git a/app/e2e/loadingAndFeedback.spec.ts b/app/e2e/loadingAndFeedback.spec.ts
index cb7ff20e..a6b45bac 100644
--- a/app/e2e/loadingAndFeedback.spec.ts
+++ b/app/e2e/loadingAndFeedback.spec.ts
@@ -94,7 +94,7 @@ test('toast yields to Ask Yogurt and returns without replacing its Undo action',
return !!a && !!b && a.x + a.width + 10 <= b.x
}).toBe(true)
await toast.hover()
- await page.getByTestId('chat-panel').evaluate(el => Promise.allSettled(el.getAnimations({ subtree: true }).filter(a => a.effect?.getComputedTiming().endTime !== Infinity).map(a => a.finished)))
+ await page.locator('.chat-morph-surface').evaluate(el => Promise.allSettled(el.getAnimations().map(a => a.finished)))
await page.emulateMedia({ colorScheme: 'dark' })
await page.screenshot({ path: testInfo.outputPath('toast-beside-chat.png') })
await page.getByTestId('chat-close').click()
@@ -106,7 +106,7 @@ test('toast yields to Ask Yogurt and returns without replacing its Undo action',
const a = await toast.boundingBox(), b = await page.getByTestId('chat-panel').boundingBox()
return !!a && !!b && b.y + b.height + 8 <= a.y
}).toBe(true)
- await page.getByTestId('chat-panel').evaluate(el => Promise.allSettled(el.getAnimations({ subtree: true }).filter(a => a.effect?.getComputedTiming().endTime !== Infinity).map(a => a.finished)))
+ await page.locator('.chat-morph-surface').evaluate(el => Promise.allSettled(el.getAnimations().map(a => a.finished)))
await page.screenshot({ path: testInfo.outputPath('toast-narrow-chat.png') })
await page.getByTestId('trash-undo').click()
await expect(toast).toHaveCount(0)
diff --git a/app/e2e/recordingReminder.spec.ts b/app/e2e/recordingReminder.spec.ts
index 731a6c74..ee2db127 100644
--- a/app/e2e/recordingReminder.spec.ts
+++ b/app/e2e/recordingReminder.spec.ts
@@ -37,7 +37,7 @@ for (const theme of ['light', 'dark'] as const) test(`standard recording reminde
return !!a && !!b && a.x + a.width + 10 <= b.x
}).toBe(true)
await toast.hover()
- await page.getByTestId('chat-panel').evaluate(el => Promise.allSettled(el.getAnimations().map(a => a.finished)))
+ await page.locator('.chat-morph-surface').evaluate(el => Promise.allSettled(el.getAnimations().map(a => a.finished)))
await page.screenshot({ path: info.outputPath(`reminder-${theme}-ask.png`) })
await page.keyboard.press('F6')
await toast.getByRole('button', { name: 'Close', exact: true }).focus()
diff --git a/app/e2e/sidebarMotion.spec.ts b/app/e2e/sidebarMotion.spec.ts
index 163b484c..aaf02a6a 100644
--- a/app/e2e/sidebarMotion.spec.ts
+++ b/app/e2e/sidebarMotion.spec.ts
@@ -99,7 +99,7 @@ test('native titlebar drag regions leave the sidebar and toolbar controls clicka
}, time)
expect(blocked, `${width}px ${direction} at ${time}ms`).toEqual([])
}
- await page.locator('.workspace').evaluate((el) => { for (const animation of el.getAnimations({ subtree: true })) animation.finish() })
+ await page.locator('.workspace').evaluate((el) => { for (const animation of el.getAnimations({ subtree: true })) if (animation.effect?.getComputedTiming().endTime !== Infinity) animation.finish() })
}
}
}
@@ -220,7 +220,7 @@ test('a note keeps its title, transcript and controls in place at the start of b
}
expect(await page.locator('.workspace-sidebar-toggle svg').innerHTML()).toBe(icon)
expect(await page.locator('.workspace-sidebar-toggle .sidebar-toggle-pane').evaluate((el) => getComputedStyle(el).opacity)).toBe('1')
- await page.locator('.workspace').evaluate((el) => { for (const animation of el.getAnimations({ subtree: true })) animation.finish() })
+ await page.locator('.workspace').evaluate((el) => { for (const animation of el.getAnimations({ subtree: true })) if (animation.effect?.getComputedTiming().endTime !== Infinity) animation.finish() })
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true)
}
}
diff --git a/app/e2e/widget.spec.ts b/app/e2e/widget.spec.ts
index 78ae3d7c..316d9883 100644
--- a/app/e2e/widget.spec.ts
+++ b/app/e2e/widget.spec.ts
@@ -48,9 +48,11 @@ test('the widget is a compact horizontal recorder with one live wave and no exte
await expect(w.getByTestId('widget')).toHaveAttribute('data-kind', 'recording')
const s = await snap(app)
expect(s.visible).toBe(true)
- expect(s.bounds).toMatchObject({ width: 127, height: 42 })
const style = await w.getByTestId('widget').evaluate((el) => ({ shadow: getComputedStyle(el).boxShadow, width: el.getBoundingClientRect().width, height: el.getBoundingClientRect().height }))
- expect(style).toMatchObject({ width: 127, height: 42 })
+ // the pill hugs its content; the window fits the pill exactly
+ expect(style.height).toBe(42)
+ expect(style.width).toBeLessThan(127)
+ expect(s.bounds).toMatchObject({ width: Math.ceil(style.width), height: 42 })
expect(style.shadow).toBe('none')
// one meter, moved by the microphone of the fake call
await expect(w.getByTestId('widget-wave')).toHaveCount(1)