import { test, expect } from '@playwright/test'; import { pasteInto, seedStudy } from './helpers.js'; test('the daily five minutes blocks pasting and saves to the note; the weekly recall rates and records', async ({ page }) => { await seedStudy(page); // daily five minutes await expect(page.getByText(/your five minutes:/i)).toBeVisible(); await page.getByRole('button', { name: 'Start' }).first().click(); const box = page.getByRole('textbox', { name: /your five minutes/i }); await expect(page.getByRole('timer')).toContainText('4:'); await pasteInto(box, 'text from somewhere else'); await expect(page.getByText(/pasting is off here/i)).toBeVisible(); await expect(box).toHaveValue(''); await box.fill('Three things I notice in the passage.'); await page.getByRole('button', { name: /save to my notes/i }).click(); await expect(page.getByText(/saved to your notes/i)).toBeVisible(); // weekly recall: write from memory, compare with the notes, rate it await page.getByRole('button', { name: 'Start' }).click(); await page.getByRole('textbox', { name: 'What you remember' }).fill('God loved the world and gave his Son so that believers would not perish.'); await page.getByRole('button', { name: 'Show my notes' }).click(); await expect(page.getByText('Your notes', { exact: true })).toBeVisible(); await page.getByRole('textbox', { name: 'What slipped' }).fill('who Jesus was talking to'); await page.getByRole('button', { name: 'Partly' }).click(); await expect(page.getByText(/recall saved/i)).toBeVisible(); // it shows in the history and in Insights await page.getByRole('button', { name: /recall history/i }).click(); await expect(page.getByText('Partly', { exact: true }).first()).toBeVisible(); await page.getByRole('button', { name: 'Insights' }).click(); await expect(page.getByRole('heading', { name: 'Insights' })).toBeVisible(); await expect(page.getByText('who Jesus was talking to')).toBeVisible(); });