test(deck): cover multi-item li rendering in deck-parse-errors#182
Open
arasaka-net[bot] wants to merge 3 commits intomainfrom
Open
test(deck): cover multi-item li rendering in deck-parse-errors#182arasaka-net[bot] wants to merge 3 commits intomainfrom
arasaka-net[bot] wants to merge 3 commits intomainfrom
Conversation
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.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
renders one <li> per distinct unrecognized card nameinsrc/scripts/deck.test.js— callscreateDeckwith two unrecognized names (Ghost Runner,Sneakdoor Beta), assertsquerySelectorAll('li')returns exactly two items, and asserts eachli.textContentmatches the expected name.Verification
node_modulesnot present in CI environment;npm testcould not be executed. Test is structurally identical to the existing XSS regression test and exercises the same jsdom path.Assumptions
allCardsmock in the test file (Hedge Fund,Sure Gamble,Ice Wall) does not includeGhost RunnerorSneakdoor Beta, making both names unrecognized as required for the test to exercise the error path.Closes #168
Arasaka Implementation Pipeline.