From 3b3e4a221fa47d0109c6ab99be65b5ba48bae254 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sat, 26 Sep 2026 11:23:52 +0100 Subject: Count the open tasks in the todo example The left field said how many tasks there were; it now says how many are still open, "2 of 3", with aup's count(t in tasks where !t.done), which Pure runs as a fold over the list on every surface. The reference model counts the same, and in the browser the field follows a task marked done. --- tests/browser.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/browser.mjs') diff --git a/tests/browser.mjs b/tests/browser.mjs index 87ad584..32cf65f 100644 --- a/tests/browser.mjs +++ b/tests/browser.mjs @@ -71,7 +71,7 @@ try { }; await until('three tasks, the last focused', `document.querySelectorAll('li').length === 3 && ${selected} === 2`); - await until('title and field', `document.querySelector('h1').textContent === 'To do' && document.querySelector('dd').textContent === '3 tasks'`); + await until('title and field', `document.querySelector('h1').textContent === 'To do' && document.querySelector('dd').textContent === '3 of 3'`); await key('ArrowUp', 'ArrowUp', 38); await until('ArrowUp moves the focus', `${selected} === 1`); const box = await evaluate(`(() => { const r = document.querySelectorAll('li')[0].getBoundingClientRect(); return [r.x + r.width / 2, r.y + r.height / 2]; })()`); @@ -80,6 +80,7 @@ try { await until('a click focuses its row', `${selected} === 0`); await key('Space', ' ', 32, ' '); await until('Space marks it done, muted', `document.querySelectorAll('li')[0].classList.contains('muted') && document.querySelector('li .badge')?.textContent === 'done'`); + await until('the count of open tasks follows', `document.querySelector('dd').textContent === '2 of 3'`); await evaluate(`document.getElementById('entry').focus()`); await send('Input.insertText', { text: '브라우저' }); await key('Enter', 'Enter', 13, '\r'); -- cgit v1.2.3