Fix flaky e2e tests#179
Open
tameware wants to merge 5 commits into
Open
Conversation
…d passes it to Node as DDS_MVP_JS (reliable under Bazel on Linux). web/tests/dds_mvp_test.mjs — Uses DDS_MVP_JS first, with fallbacks for direct node --test runs from the repo.
Pass the resolved dds_mvp.js path via DDS_MVP_JS for Bazel runfiles, and add focus() to mock DOM elements so clearTestData and pageLoad work when merged with web changes. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a deterministic unit-test harness for web/dds_mvp.js by running a Node --test suite from a Bazel py_test, aiming to reduce reliance on flaky browser-based e2e coverage for basic JS behavior.
Changes:
- Add a Node test suite (
web/tests/dds_mvp_test.mjs) that loadsweb/dds_mvp.jsin a VM with a mocked DOM and validates key functions. - Add a Bazel-driven Python wrapper test (
web/tests/test_dds_mvp_js.py) to execute the Node test runner in CI (//web:dds_mvp_js_test). - Update
web/dds_mvp.jsheader comments to reference the new unit tests and commands.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web/tests/test_dds_mvp_js.py | Python unittest wrapper that invokes node --test and wires runfiles/env for Bazel. |
| web/tests/dds_mvp_test.mjs | Node built-in test runner suite with a mocked document and VM execution of dds_mvp.js. |
| web/dds_mvp.js | Replaces TODO with pointers to the new unit tests and how to run them. |
| web/BUILD.bazel | Adds dds_mvp_js_test and includes it in the web_tests test suite. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
Please ask Copilot for another review. I had to merge with develop. I'd like to make sure I didn't miss anything. Cursor's agent is happy, but they each catch things the other doesn't. |
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.
No description provided.