Matrix / Counter label, singular vs plural
Counter label, singular vs plural
After adding one to-do, the counter should read "1 item left". The broken page always renders "items", so one to-do shows "1 items left".
What your agent will do with Beam installed
Use
Verify the exact visible text of the todo counter is "1 item left".Avoid
Verify the todo counter reads "1 item left".(False green)
Results
Before each check, Kane does: Type "buy some cheese" into the "What needs to be done?" box and press Enter.
| Wording | Kane | Correct page | Broken page | Result |
|---|---|---|---|---|
Verify the todo counter reads "1 item left".From the Kane issue | 0.10.9 | passed | passed | False green |
| 0.10.8 | passed | passed | False green | |
Verify the exact visible text of the todo counter is "1 item left".From the Kane issue | 0.10.9 | passed | failed | Balanced |
| 0.10.8 | passed | failed | Balanced |
How Kane read the page
Kane turns each wording into code that reads the page. This is the code it recorded:
Verify the todo counter reads "1 item left". False green
el(3).textContentVerify the exact visible text of the todo counter is "1 item left". Balanced
el(3).textContent + (el(3).nextSibling ? el(3).nextSibling.textContent : '')The two pages
These are live. To see the difference, do what Kane does: Type "buy some cheese" into the "What needs to be done?" box and press Enter.
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>todos</title></head><body>
<h1>todos</h1>
<input id="new" placeholder="What needs to be done?">
<span class="todo-count" data-testid="todo-count"></span>
<script>
let n = 0;
const out = document.querySelector('.todo-count');
document.getElementById('new').addEventListener('keydown', e => {
if (e.key !== 'Enter') return;
n++;
out.innerHTML = '<strong>' + n + '</strong> ' + (n === 1 ? 'item' : 'items') + ' left';
});
</script></body></html>
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>todos</title></head><body>
<h1>todos</h1>
<input id="new" placeholder="What needs to be done?">
<span class="todo-count" data-testid="todo-count"></span>
<script>
let n = 0;
const out = document.querySelector('.todo-count');
document.getElementById('new').addEventListener('keydown', e => {
if (e.key !== 'Enter') return;
n++;
out.innerHTML = '<strong>' + n + '</strong> ' + ('items') + ' left';
});
</script></body></html>
Reproduce it
Clone the repo, then run this behavior on your own Kane:
npm run suite -- plural-counter