Add opt-in monthly email recaps with scheduling and delivery history
Magent CI/CD / verify (push) Canceled after 3m55s
Magent CI/CD / deploy-prod (push) Canceled after 0s
Magent CI/CD / deploy-beta (push) Canceled after 0s

This commit is contained in:
2026-09-09 22:39:22 +12:00
parent 333a799e21
commit 1979e02cde
18 changed files with 1832 additions and 7 deletions
+11 -1
View File
@@ -92,6 +92,15 @@ const output = process.env.REVIEW_DIR
await page.screenshot({ path: path.join(output, `monthly-report-${width}.png`), fullPage: true })
}
}
const beforeLink = calls.length
await page.goto(base + '/insights/reports?month=2026-07')
await page.getByRole('heading', { name: 'July 2026', exact: true }).waitFor()
const linkedCalls = calls.slice(beforeLink).filter((call) => call.path === '/api/insights/reports/monthly')
assert.deepEqual(linkedCalls.map((call) => call.month), ['2026-07'])
await page.reload()
await page.getByRole('heading', { name: 'July 2026', exact: true }).waitFor()
await page.goto(base + '/insights/reports')
await page.getByRole('heading', { name: 'August 2026', exact: true }).waitFor()
await page.getByRole('button', { name: 'Previous month', exact: true }).click()
await page.getByRole('heading', { name: 'July 2026', exact: true }).waitFor()
await page.getByRole('button', { name: 'Next month', exact: true }).click()
@@ -126,7 +135,8 @@ const output = process.env.REVIEW_DIR
assert.equal(await page.getByRole('link', { name: 'Connect Jellystat' }).count(), 0)
mode = 'unauthorized'
await page.reload()
await page.waitForURL('**/login?next=%2Finsights%2Freports')
await page.waitForURL(/\/login\?next=/)
assert.equal(new URL(page.url()).searchParams.get('next'), `/insights/reports?month=${months.at(-1)}`)
mode = 'ready'
await page.goto(base + '/insights/reports')
await page.getByRole('heading', { name: 'August 2026', exact: true }).waitFor()