Skip to content

test: port Annotatable JS spec from openedx-platform - #319

Open
irfanuddinahmad wants to merge 1 commit into
openedx:mainfrom
irfanuddinahmad:irfanuddinahmad/annotatable-js-spec
Open

irfanuddinahmad wants to merge 1 commit into
openedx:mainfrom
irfanuddinahmad:irfanuddinahmad/annotatable-js-spec

Conversation

@irfanuddinahmad

@irfanuddinahmad irfanuddinahmad commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Update (2026-11-10): Rebased onto main after #244: the workspace moved to src/xblock_annotatable/assets/ (picked up by the root src/*/*/ workspaces glob), and the two package-lock.json entries now point there. npm ci accepts the lockfile, and npm install --package-lock-only leaves it unchanged. The spec passes (1 of 1, headless Chrome locally).

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 root src/*/*/ glob) with a minimal karma + jasmine setup, mirroring the existing Problem/Discussion/Video setups. It runs in the existing javascript-tests.yml via npm 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 from xmodule/js/fixtures/annotatable.html.
  • spec_helpers/helper.js: sets the fixtures path and adds a no-op $.fn.qtip stub. 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)

  • The initializer is the extracted block's XBlock-style Annotatable(runtime, element) instead of the built-in new Annotatable(el).
  • The qTip stub, as above.

The spec, fixture and karma files sit under assets/, which MANIFEST.in already prunes from the distribution.

Test plan

  • npm ci succeeds with the updated lockfile, and leaves it unchanged
  • Spec passes locally: Annotatable › constructor › works, 1 of 1 SUCCESS. Run in headless Chrome, because Firefox isn't available locally. CI runs the committed Firefox config.
  • Negative check: without the qTip stub the spec fails with $(...).qtip is not a function, which confirms the constructor really runs initTips over the fixture's spans
  • javascript-tests.yml passes in CI

Related: openedx/openedx-platform#38746, epic openedx/openedx-platform#37819

🤖 Generated with Claude Code

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Nov 5, 2026
@openedx-webhooks

openedx-webhooks commented Nov 5, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @irfanuddinahmad!

This repository is currently maintained by @openedx/axim-engineering.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Nov 5, 2026
@irfanuddinahmad
irfanuddinahmad marked this pull request as ready for review November 5, 2026 13:23
@irfanuddinahmad

Copy link
Copy Markdown
Contributor Author

@farhan this ports the one test that openedx/openedx-platform#38746 removes without a counterpart here: xmodule/js/spec/annotatable/display_spec.js. It follows the rule we agreed on (no test deleted: moved here, or kept in the platform with modifications). The name, fixture and logic are unchanged. The only adaptations are the Annotatable(runtime, element) initializer and a $.fn.qtip stub for the globally loaded qTip plugin. The new Annotatable karma setup runs in CI, and the job log shows Annotatable › constructor › works passing in Firefox. Could you take a look?

| 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]>
@irfanuddinahmad
irfanuddinahmad force-pushed the irfanuddinahmad/annotatable-js-spec branch from 80ff97c to 8088f64 Compare November 10, 2026 07:54
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants