mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Five mocha suites sat in the tree looking like they were being run, and were not: `meteor.testModule` points at client/lib/tests/index.js and server/lib/tests/index.js, those indexes list their suites with explicit imports, and these five were never added. server/lib/tests had 49 suite files but 48 imports. Two of them are *bleed security regression suites - checklistbleed (cross-board checklist/checklist-item move denial) and proxybleed (header-login trusted-source and request-IP handling) - exactly the kind of test whose silent absence lets a fixed vulnerability come back unnoticed. The other three are filenameTruncation, alwaysShowCodeAsText and renderLinksPlainText. All five are now imported by their index. Every symbol they import was checked to still exist first: denyCrossBoardMoveByCard / denyCrossBoardMoveByChecklistItem (server/lib/utils.js), getRequestIp / isTrustedHeaderLoginSource / findOrCreateHeaderLoginUser (server/lib/headerLoginAuth.js), truncateFilenameToBytes / sanitizeFilename (models/lib/filenameSanitizer.js), getSecureDOMPurifyConfig / sanitizeHTML (imports/lib/secureDOMPurify.js) and the Markdown export of the wekan-markdown package. They have never run in this state, so they may still fail on their assertions - that is the point of running them. tests/testsAreRegistered.test.cjs is added as a guard: it fails if any *.tests.js file in either directory is not imported by its index, and names the two *bleed suites explicitly so a future tidy-up cannot drop them again quietly. Also deletes files that nothing loads: - client/components/main/responsiveFixes.css (162 lines, imported by nothing, so never in the bundle - package.json sets meteor.mainModule, which disables Meteor's eager loading). - models/backgrounds.js, models/backgrounds.server.js and server/permissions/backgrounds.js - three empty tombstones whose only content was a comment saying board backgrounds became board-level Attachments and the file is "intentionally empty and no longer imported". The live paths (server/boardBackgrounds.js, server/publications/backgrounds.js) are different files and are untouched. Thanks to xet7 !