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.

Tests: end-to-end checks follow the new agenda markers and Take notes button

Eric Brownroutaf3654efc39a
diff --git a/app/e2e/agendaCard.spec.ts b/app/e2e/agendaCard.spec.ts
index ff8b20d0..f49b16c3 100644
--- a/app/e2e/agendaCard.spec.ts
+++ b/app/e2e/agendaCard.spec.ts
@@ -14,8 +14,7 @@ test('a bottom event opens above its row, tracks scrolling, flips without chatte
await page.clock.setFixedTime(noon)
await app.evaluate((_electron, noon) => {
const events = Array.from({ length: 24 }, (_, i) => ({
- // Keep noon's live CTA in the day, but use a regular event as the scrolling anchor.
- // A live row is taller, so even near the list top it can correctly retain its top placement.
+ // Keep a live meeting in the day, but use a regular event as the scrolling anchor.
id: `day-${i}`, title: i === 13 ? 'Sprint planning' : `Meeting ${i + 1}`,
start: new Date(noon + (i - 12) * 30 * 60_000).toISOString(),
end: new Date(noon + (i - 12) * 30 * 60_000 + 25 * 60_000).toISOString(),
@@ -32,8 +31,7 @@ test('a bottom event opens above its row, tracks scrolling, flips without chatte
const card = page.getByTestId('event-details-content')
const placeRow = async (edge: 'top' | 'bottom') => row.evaluate((el, edge) => {
const list = el.closest<HTMLElement>('.agenda-scroll')!, r = el.getBoundingClientRect(), bounds = list.getBoundingClientRect()
- // Align the row itself with the list top. A 20px inset leaves only 15px more room
- // below in the CI window, correctly short of the production 24px flip threshold.
+ // Align the row itself with the list top, independent of its content height.
list.scrollTop += edge === 'bottom' ? r.bottom - bounds.bottom + 12 : r.top - bounds.top
}, edge)
const geometry = () => card.evaluate(el => {
@@ -42,6 +40,7 @@ test('a bottom event opens above its row, tracks scrolling, flips without chatte
return {
left: card.left - column.left, right: column.right - card.right,
top: card.top, bottom: card.bottom, rowTop: row.top, rowBottom: row.bottom, height: innerHeight,
+ columnTop: Math.max(0, column.top), columnBottom: Math.min(innerHeight, column.bottom),
roomAbove: Math.max(0, row.top - Math.max(0, column.top) - 20),
roomBelow: Math.max(0, Math.min(innerHeight, column.bottom) - row.bottom - 20),
}
@@ -97,15 +96,17 @@ test('a bottom event opens above its row, tracks scrolling, flips without chatte
await expect.poll(async () => Math.abs((await geometry()).bottom - initial.bottom + 32)).toBeLessThan(1)
expect(await card.evaluate(el => el.getAnimations().length)).toBe(0)
await placeRow('top')
- // In a short window the calendar header can leave more room above every visible row.
- const topSide = height > 650 ? 'bottom' : 'top'
const atTop = await geometry()
- // Assert the fixture's actual room, rather than treating the outer BrowserWindow height
- // as proof of a flip. The bottom side must beat the existing side by more than 24px.
- if (topSide === 'bottom') expect(atTop.roomBelow - atTop.roomAbove).toBeGreaterThan(24)
- else expect(atTop.roomBelow - atTop.roomAbove).toBeLessThanOrEqual(24)
+ // Compact rows can flip even in the short window; use measured room, not window height.
+ const topSide = atTop.roomBelow - atTop.roomAbove > 24 ? 'bottom' : 'top'
+ if (height > 650) expect(topSide).toBe('bottom')
await expect(card).toHaveAttribute('data-side', topSide)
- if (topSide === 'bottom') await expect.poll(async () => (await geometry()).top - (await geometry()).rowBottom).toBeGreaterThanOrEqual(7)
+ if (topSide === 'bottom' && atTop.roomBelow >= initial.bottom - initial.top) {
+ await expect.poll(async () => (await geometry()).top - (await geometry()).rowBottom).toBeGreaterThanOrEqual(7)
+ }
+ // When neither side fits the full card, collision handling keeps it inside the column.
+ await expect.poll(async () => (await geometry()).top).toBeGreaterThanOrEqual(atTop.columnTop + 8)
+ await expect.poll(async () => (await geometry()).bottom).toBeLessThanOrEqual(atTop.columnBottom - 8)
// Small scroll reversals around this placement must not restart the side-change motion.
for (const delta of [3, -5, 4, -2]) {
await list.evaluate((el, delta) => { el.scrollTop += delta }, delta)
diff --git a/app/e2e/agendaNoteRibbon.spec.ts b/app/e2e/agendaNoteRibbon.spec.ts
index 16aa3964..0a63a6ec 100644
--- a/app/e2e/agendaNoteRibbon.spec.ts
+++ b/app/e2e/agendaNoteRibbon.spec.ts
@@ -3,7 +3,7 @@ import { mkdtempSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
-test('an event with notes gets a purple line beside it in the agenda', async () => {
+test('an event with notes gets a muted notes icon and only a live event gets a purple line', async () => {
const app = await electron.launch({ args: [join(import.meta.dirname, '../out/main/index.js')], env: {
...process.env, YOGURT_FAKE: '1', YOGURT_USER_DATA: mkdtempSync(join(tmpdir(), 'yogurt-agenda-ribbon-')),
} })
@@ -14,19 +14,30 @@ test('an event with notes gets a purple line beside it in the agenda', async ()
await page.clock.setFixedTime(now)
const events = ['Planning', 'Retro'].map((title, i) => ({ id: `event-${i}`, title, calendar: 'Work',
start: new Date(+now + (i + 1) * 60 * 60_000).toISOString(), end: new Date(+now + ((i + 1) * 60 + 30) * 60_000).toISOString(), attendees: [] }))
+ events.push({ id: 'live', title: 'Current review', calendar: 'Work', start: new Date(+now - 60_000).toISOString(), end: new Date(+now + 30 * 60_000).toISOString(), attendees: [] })
await app.evaluate((_e, events) => (globalThis as any).__fake__.calendarEvents(events), events)
await page.reload()
const row = (title: string) => page.getByTestId('event').filter({ has: page.getByRole('button', { name: title, exact: true }) })
const line = (title: string) => row(title).locator('.agenda-event-body').evaluate(el => getComputedStyle(el).borderInlineStartColor)
- const accent = await page.evaluate(() => { const s = document.createElement('span'); s.style.color = 'var(--accent)'; document.body.append(s); const c = getComputedStyle(s).color; s.remove(); return c })
+ const { accent, muted } = await page.evaluate(() => {
+ const s = document.createElement('span'); document.body.append(s)
+ s.style.color = 'var(--accent)'; const accent = getComputedStyle(s).color
+ s.style.color = 'var(--muted)'; const muted = getComputedStyle(s).color
+ s.remove(); return { accent, muted }
+ })
await expect.poll(() => line('Planning')).not.toBe(accent)
+ await expect(row('Planning').getByRole('img', { name: 'Has notes', exact: true })).toHaveCount(0)
+ await expect.poll(() => line('Current review')).toBe(accent)
// notes made for the event (Prepare note in its card)
expect(await page.evaluate(day => window.yogurt.meetings.prepare('event-0', day), +now)).toHaveProperty('id')
await expect(page.getByTestId('note-title')).toHaveText('Planning')
await page.getByTestId('nav-home').click()
- await expect.poll(() => line('Planning')).toBe(accent)
await expect(row('Planning')).toHaveAttribute('data-has-note', 'true')
+ await expect(row('Planning').getByRole('img', { name: 'Has notes', exact: true })).toHaveCSS('color', muted)
+ expect(await line('Planning')).not.toBe(accent)
+ expect(await line('Current review')).toBe(accent)
expect(await line('Retro')).not.toBe(accent)
+ await expect(row('Retro').getByRole('img', { name: 'Has notes', exact: true })).toHaveCount(0)
} finally { await app.close() }
})
diff --git a/app/e2e/notesSetup.spec.ts b/app/e2e/notesSetup.spec.ts
index 661c809f..1c1c9630 100644
--- a/app/e2e/notesSetup.spec.ts
+++ b/app/e2e/notesSetup.spec.ts
@@ -44,7 +44,9 @@ async function expectClear(page: Page) {
const others = document.querySelectorAll('.workspace-sidebar-toggle, [data-testid="recording-return"], [data-testid="note-menu-button"], #workspace-actions button')
return box.width >= 44 && box.x >= 0 && box.right <= innerWidth && [...others].every(other => {
const rect = other.getBoundingClientRect()
- return box.right <= rect.x || box.x >= rect.right
+ return rect.width > 0 && rect.x >= 0 && rect.right <= innerWidth
+ && (box.right <= rect.x || box.x >= rect.right)
+ && other.contains(document.elementFromPoint(rect.x + rect.width / 2, rect.y + rect.height / 2))
}) && el.contains(document.elementFromPoint(box.x + box.width / 2, box.y + box.height / 2))
})).toBe(true)
}
@@ -154,6 +156,12 @@ test('AI status stays on every workspace page and clears recording and More in n
const { app, page } = await launch()
try {
await app.evaluate(() => (globalThis as unknown as { __fake__: { manyMeetings(o: { n: number; clean: boolean }): void } }).__fake__.manyMeetings({ n: 2, clean: true }))
+ await app.evaluate(() => {
+ const now = Date.now()
+ ;(globalThis as unknown as { __fake__: { calendarEvents(events: unknown[]): void } }).__fake__.calendarEvents([
+ { id: 'live', title: 'Planning the next release and reviewing open questions '.repeat(4), start: new Date(now - 60_000).toISOString(), end: new Date(now + 30 * 60_000).toISOString(), attendees: [] },
+ ])
+ })
await page.reload()
await expect(page.getByTestId('home')).toBeVisible()
const [other, trashed] = (await page.evaluate(() => window.yogurt.meetings.cards({ limit: 10 }))).map(card => card.id)
@@ -180,7 +188,8 @@ test('AI status stays on every workspace page and clears recording and More in n
if (await toggle.getAttribute('aria-expanded') !== String(!collapsed)) await toggle.click()
for (const route of ['', `/folder/${folder!.id}`]) {
await go(page, route)
- await expect(page.locator('#workspace-actions button')).toBeVisible()
+ await expect(page.getByTestId(route ? 'start-recording' : 'new-note')).toBeVisible()
+ await expect(page.getByTestId('recording-choices')).toBeVisible()
await expectClear(page)
}
}
diff --git a/app/e2e/startRecording.spec.ts b/app/e2e/startRecording.spec.ts
index c06b696c..fccbb49d 100644
--- a/app/e2e/startRecording.spec.ts
+++ b/app/e2e/startRecording.spec.ts
@@ -158,6 +158,8 @@ test('localized recording actions leave room for a long folder title at the smal
{ id: 'long-title', title, start: new Date(now - 60_000).toISOString(), end: new Date(now + 30 * 60_000).toISOString(), attendees: [] },
])
}, title)
+ // The fake calendar hook refreshes main's consumers; reload to read it in the renderer.
+ await page.reload()
await expect(page.getByTestId('start-recording')).toHaveAttribute('title', `Take notes · ${title}`)
await app.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows().find(w => !w.webContents.getURL().includes('#'))!.setSize(720, 520))
await expect.poll(() => page.evaluate(() => innerWidth)).toBe(720)