All Challenges

Todo List with Filter & Priority

TypeScriptEasySwiggyBrowserStackChargebee
30:00

Problem Brief

Implement a priority-tagged task manager supporting add, complete toggle, delete, and live All / Active / Done filters.

Requirements

  • Add tasks from `[data-testid="todo-input"]` + `[data-testid="priority-select"]` when clicking `[data-testid="add-todo"]`.
  • Render `.todo-item` rows inside `[data-testid="todo-list"]` showing title and priority.
  • Clicking `.todo-toggle` marks a task done; clicking `.todo-delete` removes it.
  • Filter buttons (`[data-filter="all"]`, `[data-filter="active"]`, `[data-filter="done"]`) update visible rows.
Progressive Hints (2)
  • Store `{ id, text, priority, done }` objects in an array and re-render filtered by `currentFilter`.
  • Ignore empty/whitespace-only inputs on Add.
Reference Solution

Stuck? Load the verified reference code into your editor.

Automated Test Suite

5 Test Cases Ready
  • Adds task with chosen priorityAppends .todo-item showing task text and priority badge
  • Ignores empty task submissionsWhitespace-only input does not add an item
  • Toggle checkbox updates done statusMarking task done keeps checked state on row
  • Active & Done filters show matching subsetsFiltering Done hides incomplete tasks and vice-versa
  • Delete button removes task from listClicking .todo-delete deletes the row
solution.html
Live Sandboxed Previewiframe sandbox
Starter template loaded — add your <script> logic in the editor (or open Reference Solution) to make the widget interactive.