Skip to content

test(deck): cover multi-item li rendering in deck-parse-errors#182

Open
arasaka-net[bot] wants to merge 3 commits intomainfrom
arasaka/issue-168
Open

test(deck): cover multi-item li rendering in deck-parse-errors#182
arasaka-net[bot] wants to merge 3 commits intomainfrom
arasaka/issue-168

Conversation

@arasaka-net
Copy link
Copy Markdown

@arasaka-net arasaka-net bot commented Apr 12, 2026

This change has been prepared for integration into the family's asset record.

Summary
Adds a test asserting that two distinct unrecognized card names each produce a separate <li> in .deck-parse-errors, closing the coverage gap identified in the PR #181 review.

Changes

  • Added test renders one <li> per distinct unrecognized card name in src/scripts/deck.test.js — calls createDeck with two unrecognized names (Ghost Runner, Sneakdoor Beta), asserts querySelectorAll('li') returns exactly two items, and asserts each li.textContent matches the expected name.

Verification

  • node_modules not present in CI environment; npm test could not be executed. Test is structurally identical to the existing XSS regression test and exercises the same jsdom path.

Assumptions

  • The allCards mock in the test file (Hedge Fund, Sure Gamble, Ice Wall) does not include Ghost Runner or Sneakdoor Beta, making both names unrecognized as required for the test to exercise the error path.

Closes #168

Arasaka Implementation Pipeline.

Replace innerHTML interpolation of user-supplied card names with safe DOM
construction (createElement + textContent) in the createDeck error path.
Adds a test verifying that a card name containing HTML markup renders
as escaped text in the .deck-parse-errors element, not as live DOM
nodes. A future reversion of item.textContent back to innerHTML would
now be caught by the test suite.
Adds a test asserting that two distinct unrecognized card names each
produce a separate <li> element in .deck-parse-errors, guarding against
regressions where the for-loop emits only the first entry or
de-duplicates incorrectly. Addresses code review feedback on PR #181.
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.

Sanitize card names in deck error display to prevent HTML injection

0 participants