diff --git a/test/e2e.spec.ts b/test/e2e.spec.ts index 617aafa9..a827c902 100644 --- a/test/e2e.spec.ts +++ b/test/e2e.spec.ts @@ -58,10 +58,23 @@ describe('nuxt-time', async () => { it('displays relative time correctly', async () => { const page = await createPage(undefined, { locale: 'en-GB' }) + const logs: string[] = [] + + page.on('console', (event) => { + if (!event.text().includes('')) { + logs.push(event.text()) + } + }) + await page.goto(url('/'), { waitUntil: 'networkidle' }) expect(await page.getByTestId('relative').textContent()).toMatchInlineSnapshot( - '"5 minutes ago"', + '"30 seconds ago"', ) + + await page.getByTestId('relative').getByText('32 seconds ago').textContent() + + // No hydration errors + expect(logs.join('')).toMatchInlineSnapshot('""') }) })