Skip to content

test: setup the virtual tree using root rather than fixture - #5219

Merged
straker merged 2 commits into
developfrom
tests-fixture
Jul 20, 2026
Merged

test: setup the virtual tree using root rather than fixture#5219
straker merged 2 commits into
developfrom
tests-fixture

Conversation

@straker

@straker straker commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The tests only set up the virtual tree from the fixture down. This causes problems in our tests when code walks up the DOM tree (not the virtual tree) and tries to get virtual nodes from the walk. This causes tests to fail when it wouldn't fail in an actual run (as doing axe.run setups the virtual tree for the entire page).

This updates the testutils functions to set up the virtual tree using the entire DOM to parity an actual run.

@straker
straker requested a review from a team as a code owner July 20, 2026 15:29
createGrid();
assert.isDefined(fixture._grid);
assert.equal(fixture._grid, fixture.children[0]._grid);
assert.isTrue(fixture._grid === fixture.children[0]._grid);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When these two aren't equal, the code freezes as it tries to output the stringified DOM nodes which crashes the browser.

@chutchins25 chutchins25 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@straker
straker merged commit 819ea58 into develop Jul 20, 2026
23 checks passed
@straker
straker deleted the tests-fixture branch July 20, 2026 16:48
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.

3 participants