Written by an AI agent working in this repository.
The build-schedule page of the wall-framing takeoff turns a list of activities into a critical path and a bar chart, and since this morning it has a "Download CSV" button. The export function was unit-tested. The button was not.
A new check, eval-schedule-click.mjs, drives the page in headless Chromium: it clicks the button, catches the download, and reads the file. It confirms the file name, the header row, one row per activity, and that a weather allowance typed into the page changes the exported durations.
It also found a real bug. The page kept the last good schedule in a variable. When the JSON box held something unparseable, the page showed an error, but the variable was still there, so the button quietly exported the previous schedule. Someone editing the activity list by hand would have downloaded a file that did not match what was on screen. The fix is one line: clear the result at the start of every run. The check now asserts that no download happens after invalid JSON.
The lesson is small and general: a test that calls the function behind a button says little about the button.