Repository navigation
test: port Annotatable JS spec from openedx-platform - #319
irfanuddinahmad wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @irfanuddinahmad! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
|
@farhan this ports the one test that openedx/openedx-platform#38746 removes without a counterpart here: | Generated using Claude Code |
Adds a karma/jasmine setup for the Annotatable XBlock (mirroring the existing Problem/Discussion/Video setups) and ports xmodule/js/spec/annotatable/display_spec.js with its fixture, which openedx/openedx-platform#38746 removes along with the built-in block. The test name, fixture and logic are unchanged; only the initializer call is adapted to the extracted block's Annotatable(runtime, element), and a no-op $.fn.qtip stub replaces the globally loaded qTip vendor plugin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
80ff97c to
8088f64
Compare
Summary
Ports the Annotatable JS spec from openedx-platform into this repo, following the Slash-n-Burn test rule agreed with @farhan: no platform test is deleted; it is either moved here or kept in the platform with modifications.
openedx/openedx-platform#38746 removes the built-in Annotatable block, including
xmodule/js/spec/annotatable/display_spec.js. That spec had no counterpart here, and this block had no JS test setup at all, so this PR adds both.Changes
src/xblock_annotatable/assets/: a new npm workspace (picked up by the rootsrc/*/*/glob) with a minimal karma + jasmine setup, mirroring the existing Problem/Discussion/Video setups. It runs in the existingjavascript-tests.ymlvianpm run test-ci.spec/annotatable_spec.js: ported test. It keeps the original name (Annotatable › constructor › works), structure and fixture, and notes where it came from.fixtures/annotatable.html: copied unchanged fromxmodule/js/fixtures/annotatable.html.spec_helpers/helper.js: sets the fixtures path and adds a no-op$.fn.qtipstub. In the LMS, the qTip plugin is loaded globally. The platform karma setup loaded the real vendor file.package-lock.json: only the two entries for the new workspace (+16 lines).Adaptations (only what the extracted block requires)
Annotatable(runtime, element)instead of the built-innew Annotatable(el).The spec, fixture and karma files sit under
assets/, whichMANIFEST.inalready prunes from the distribution.Test plan
npm cisucceeds with the updated lockfile, and leaves it unchangedAnnotatable › constructor › works, 1 of 1 SUCCESS. Run in headless Chrome, because Firefox isn't available locally. CI runs the committed Firefox config.$(...).qtip is not a function, which confirms the constructor really runsinitTipsover the fixture's spansjavascript-tests.ymlpasses in CIRelated: openedx/openedx-platform#38746, epic openedx/openedx-platform#37819
🤖 Generated with Claude Code