Repository navigation
Conversation
AssetModelTest and MapResourceTest left a custom asset type and empty map settings in tmp/, which the UI app test manager then loaded. getClientRoles now falls back to the admin config, so the role assertions in the users page fixture check the realm's roles.
Ekhorn
force-pushed
the
test/clean-up-persisted-test-state
branch
from
November 19, 2026 17:02
80a67aa to
df9e402
Compare
|
MartinaeyNL
reviewed
Nov 20, 2026
| * @param config The axios request config | ||
| */ | ||
| async getClientRoles(config?: AxiosRequestConfig<any>) { | ||
| config ??= await this.adminConfig(); |
Member
There was a problem hiding this comment.
Important: this only takes effect where manager.realm is set.
users.test.ts never calls manager.setup(...), so this.realm! is undefined → the request hits user/undefined/openremote/roles → 404 → the error is swallowed → getAllRoles() returns [] → the role assertions in that spec stay vacuous even with this fix.
It does work in test.setup.ts ("Add user called smartcity") and roles.test.ts, where setup() sets the realm. Consider setting this.realm when switching realm via the picker so users.test.ts asserts something too.
This branch has not been deployed
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.



Description
Clean up state left by backend specs and fix UI test role lookup
Running
./gradlew testlocally made the manager app tests fail. The backend specs left files intmp/, and the app test manager loads them from the same storage dir. CI runs the app tests on a clean checkout, so it didn't catch this.AssetModelTestdeletes itsCustomAssettype fromtmp/asset_modelincleanupSpec. The configuration item tests listed itsdynamicMetaitem, which the Thing asset dialog doesn't show.MapResourceTestdeletestmp/manager/mapsettings.jsonandtmp/map/eindhoven.mbtilesincleanupSpec. Without that, the map tests started without a view or geocoder URL.getClientRolesin the manager test fixture falls back to the admin config. The users page fixture called it without one, got a 403 and got an empty role list, sotoHaveAllRolesand the "other roles unselected" check passed without checking anything.Checklist