镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

test: run the JavaScript of the timeline page in jsdom - #38

Merged
danifischer merged 1 commit into
masterfrom
test/page-javascript
Nov 12, 2026
Merged

danifischer merged 1 commit into
masterfrom
test/page-javascript

Conversation

@danifischer

Copy link
Copy Markdown
Owner

What

The page from #36 had no automated tests for its JavaScript. tests-js/ loads the real raidTimeline.Logic/template.html into jsdom with small hand-made data and checks what the page renders and does (34 tests, Node's built-in test runner, jsdom is the only dependency).

Covered: empty / broken data, raid day tabs (order, click, keyboard, url hash), downtime and long breaks, grouped tries with the comparison to the previous one, boss health of wipes, the day strip, dps / mechanics / boons / resurrects tables, view and theme (incl. remembered values), statistics page, icon fallback, and hostile data (names escaped, javascript: links become #, </script> in the data).

I checked that a test fails when the code is broken (replaced safeUrl by a pass-through).

CI

ci.yml gets Node 24 setup, npm ci and npm test in tests-js. The README has a short "Page tests" section.

Not covered

  • The test data is hand-made in the shape TimelineDataBuilder writes (see tests-js/page.js); a change to that json has to be mirrored there
  • Layout / CSS, scroll hints of the day tabs and the tooltip are not tested (jsdom has no layout)

🤖 Generated with Claude Code

34 tests load template.html with small data and check the days and tabs,
downtime, grouped tries, the tables, views, theme, statistics and that
data from the logs cannot become markup or a script url. Runs in CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@danifischer
danifischer merged commit 6fe788b into master Nov 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant