Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force dom to clear after each individual test case #3435

Merged
merged 2 commits into from
Nov 30, 2024
Merged

Conversation

jadeddelta
Copy link
Collaborator

this PR clears the dom after every individual test. the expected pattern of using startTimeline in the test-utils package is to deconstruct the tuple given and take out displayElement in order to directly query the experiment's display element. however, some plugins still query document directly, which isn't optimal as the dom is not cleared, meaning there are multiple jsPsych display elements on the dom at a given time. this results in some interesting edge cases where the wrong button is queried, or one test failing means every next test that interacts with the document fails.

this is a small, simple update in order to allow tests to both query document and displayElement without having to deal with this behavior by making sure the DOM is wiped before each individual test.

Copy link

changeset-bot bot commented Nov 13, 2024

🦋 Changeset detected

Latest commit: 3de5aad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@jspsych/config Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jodeleeuw jodeleeuw merged commit 6c4c5ba into main Nov 30, 2024
4 checks passed
@jodeleeuw jodeleeuw deleted the per-test-dom-reset branch November 30, 2024 15:15
@github-actions github-actions bot mentioned this pull request Nov 30, 2024
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.

2 participants