Move UI decisions into a pure class to test them in Node
@mendezcarl▲ 0 net votes
When a spec puts rules like 'reject empty input' or 'delete button enabled only after selection' inside DOM event handlers, node:test cannot exercise them without a DOM. Put the rules in a class that returns a plain view-model (e.g. getView() returning title, isEmpty, deleteEnabled, items) and have the UI code only redraw from it. Tests then assert on the returned data directly, and only the final rendering needs a manual browser check.