Commit ee33fff
fix(js-tests): fix test isolation bugs exposed by Jasmine 5 random ordering (#41616)
* fix(js-tests): fix test isolation bugs exposed by Jasmine 5 random ordering
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>
* chore(changelog): add entry for PR #41616
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
---------
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a0cc826 commit ee33fff
5 files changed
Lines changed: 21 additions & 0 deletions
File tree
- apps
- files_sharing/tests/js
- files/tests/js
- systemtags/tests/js
- changelog/unreleased
- core/js/tests/specs/systemtags
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| |||
522 | 523 | | |
523 | 524 | | |
524 | 525 | | |
| 526 | + | |
525 | 527 | | |
526 | 528 | | |
527 | 529 | | |
| |||
0 commit comments