fix(js-tests): fix test isolation bugs exposed by Jasmine 5 random ordering - #41616
Merged
Conversation
…dering
Jasmine 5 runs tests in random order by default, which exposed several
pre-existing test isolation bugs where shared singleton state was left
dirty between tests.
Fixes:
- fileactionsmenuSpec.js: call OC.hideMenus() in afterEach to clear
OC._currentMenu before calling menu.remove(), preventing a stale
reference from triggering a double slideUp in subsequent tests
- files_sharing/appSpec.js: save and restore OCA.Files.fileActions in
the 'file actions' describe's beforeEach/afterEach so that stale
_onActionsUpdated handlers registered by OCA.Files.App (in files/appSpec.js)
don't fire with fileList=null and cause infinite recursion
- systemtagsinfoviewSpec.js: reset allTagsCollection (OC.SystemTags.collection
singleton) in beforeEach and afterEach of the 'events' describe, so that
model mutations (e.g. set('name', 'test1_renamed')) don't persist into
subsequent test suites
- systemtagsinputfieldSpec.js: call view.collection.reset() in both the
'as admin' and 'as user' initSelection beforeEach blocks so that stale
models with matching ids from prior tests are cleared before adding
fresh testTags (Backbone.add silently ignores duplicate-id models)
All fixes verified with 25 consecutive successful karma runs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
DeepDiver1975
added a commit
that referenced
this pull request
Jun 11, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
DeepDiver1975
force-pushed
the
fix/js-test-isolation-jasmine5
branch
from
June 11, 2026 16:28
7c0ca89 to
77922f5
Compare
phil-davis
approved these changes
Jun 11, 2026
This was referenced Jun 11, 2026
Closed
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.
Summary
fileactionsmenuSpec.js: CallOC.hideMenus()inafterEachto clearOC._currentMenubeforemenu.remove(), preventing a doubleslideUpin subsequent testsfiles_sharing/appSpec.js: Save and restoreOCA.Files.fileActionsin thefile actionsdescribe so stale_onActionsUpdatedhandlers fromfiles/appSpec.jsdon't fire withfileList=nullcausing infinite recursionsystemtagsinfoviewSpec.js: ResetallTagsCollection(theOC.SystemTags.collectionsingleton) inbeforeEach/afterEachof theeventsdescribe so name mutations (e.g.set('name', 'test1_renamed')) don't persist into other test suitessystemtagsinputfieldSpec.js: Callview.collection.reset()in both theas adminandas userinitSelectionbeforeEachblocks so Backbone's silent ignore of duplicate-idadd()calls doesn't leave stale/renamed models in the singletonRoot cause
Jasmine 5 (bumped in #41615) runs tests in random order by default. This exposed pre-existing test isolation bugs where shared singleton state (
OC._currentMenu,OCA.Files.fileActions,OC.SystemTags.collection) was left dirty between tests.Test plan
FirefoxHeadless)🤖 Generated with Claude Code