Ticket board: validation, cleanup and acceptance
Project milestone
Finish the ticket board by testing invalid input, keyboard use and cleanup. Treat the user interface as a resource with an explicit lifetime.
Run the examples
Open projects/ticket-board/index.html fresh for each example and run the JavaScript in its browser console.
document.querySelector('#title').value = ' ';document.querySelector('#create').requestSubmit();console.log(document.querySelectorAll('#tickets li').length);Expected console output:
0Whitespace is rejected after trimming.
Open projects/ticket-board/index.html fresh for each example and run the JavaScript in its browser console.
disposeBoard();console.log(document.querySelector('#create button').disabled);console.log(document.querySelector('#filter').disabled);Expected console output:
truetrueDisposal disables both controls and removes listeners through the signal.
Implementation and contract
The same AbortSignal is attached to the form, filter and list listeners. disposeBoard() aborts that signal and disables action controls. The status paragraph has role=status, so updates can be announced by assistive technology. Use the supplied Playwright tests to verify observable behavior; a screen-reader session is a separate acceptance activity.
Common mistakes
Do not assume required rejects whitespace-only text; trim and validate the domain value. A DOM assertion does not prove all accessibility requirements.
Acceptance task
Run test.py; then manually navigate the board using only Tab, Enter and Space, and record any focus problems.
Project source, setup and tests: projects/ticket-board/README.md. Read the implementation before modifying it; the tests check the supplied baseline, not every possible implementation.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Ticket board: validation, cleanup and acceptance — Knowledge Check
Assess implementation decisions and project behavior.
What does aborting the common listener signal achieve?
Why use a status region rather than a blocking alert for counts?
Which acceptance check needs more than DOM assertions?
In the Ticket board: validation, cleanup and acceptance lab, what does this independent example log? document.querySelector('#title').value = ' '; document.querySelector('#create').requestSubmit(); console.log(document.querySelectorAll('#tickets li').length);
In the Ticket board: validation, cleanup and acceptance lab, what does this independent example log? disposeBoard(); console.log(document.querySelector('#create button').disabled); console.log(document.querySelector('#filter').disabled);