Skip to content

Feat: add Jest regression test for dhtmlx-gantt upgrades#220

Merged
stonebuzz merged 1 commit into
mainfrom
feat_jest
Jul 13, 2026
Merged

Feat: add Jest regression test for dhtmlx-gantt upgrades#220
stonebuzz merged 1 commit into
mainfrom
feat_jest

Conversation

@Rom1-B

@Rom1-B Rom1-B commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes #N/A
  • Dependabot bumps of dhtmlx-gantt can silently break the Gantt view without showing up in the diff (v10.0.0 turned out to make window.gantt undefined at runtime).
    This adds a Jest test loading the actual built bundle (public/lib/libs.js) and asserting the gantt API surface used by gantt-helper.js is present, so the shared plugin CI catches this class of regression automatically.
    The plugin relies on GLPI core's own jest/jest-environment-jsdom install (via the CI's ../../node_modules/.bin/jest fallback), so no new devDependency was added.

Screenshots (if appropriate):

@Rom1-B Rom1-B requested a review from stonebuzz July 10, 2026 14:46
Comment thread package.json
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^7.1.4",
"file-loader": "^6.2.0",
"script-loader": "^0.7.2",

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.

Suggested change
"jest": "^30.0.5",
"jest-environment-jsdom": "^30.0.5",
"script-loader": "^0.7.2",

jest and jest-environment-jsdom are used by the test script but absent from devDependencies.

so jest --colors will fail with "command not found" in any environment that does not already have GLPI core's ../../node_modules/.bin/jest.

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.

npm run walks up parent node_modules/.bin dirs automatically, so npm test in plugins/gantt already resolves jest from GLPI core's ../../node_modules/.bin/jest ; same fallback pattern the Makefile already uses for phpunit/phpstan.

CI doesn't even go through npm test: continuous-integration.yml calls the binary directly with an explicit fallback (node_modules/.bin/jest../../node_modules/.bin/jest).

Only breaks if you run the plugin fully standalone outside a GLPI checkout ; same limitation already accepted for the PHP tools. So nothing to change.

@Rom1-B Rom1-B requested a review from stonebuzz July 13, 2026 11:26
@stonebuzz stonebuzz merged commit 1fd3b10 into main Jul 13, 2026
3 checks passed
@stonebuzz stonebuzz deleted the feat_jest branch July 13, 2026 12:18
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