-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 2024.01.xx]: #10414: Remove the list of associated groups o…
…f logged in user from the User Details modal window (#10415) (#10447) * #10418: Share tool - the 'Add place mark and zoom to sharing link' option is not applied correctly (#10419) * backport #10414 with fix conflict in migration file * fix migration conflict during merge
- Loading branch information
1 parent
5ba6f0d
commit 59ea05b
Showing
3 changed files
with
80 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,4 +75,49 @@ describe("Test user details modal", () => { | |
|
||
expect(modalDOM.getElementsByClassName('row').length).toEqual(6); | ||
}); | ||
it('test hide group user info if hideGroupUserInfo = true', () => { | ||
let testUser = { | ||
"attribute": [ | ||
{ | ||
"name": "company", | ||
"value": "Some Company" | ||
}, | ||
{ | ||
"name": "email", | ||
"value": "[email protected]" | ||
}, | ||
{ | ||
"name": "notes", | ||
"value": "some notes" | ||
}, | ||
{ | ||
"name": "UUID", | ||
"value": "260a670e-4dc0-4719-8bc9-85555d7dcbe1" | ||
} | ||
], | ||
"enabled": true, | ||
"groups": { | ||
"group": { | ||
"enabled": true, | ||
"groupName": "everyone", | ||
"id": 3 | ||
} | ||
}, | ||
"id": 6, | ||
"name": "admin", | ||
"role": "ADMIN" | ||
}; | ||
let displayAttributes = (attr) => { | ||
return attr.name && attr.name === "email" || attr.name === "company"; | ||
}; | ||
const cmpNormal = ReactDOM.render(<UDModal options={{animation: false}} show displayAttributes={displayAttributes} user={testUser}/>, document.getElementById("container")); | ||
expect(cmpNormal).toExist(); | ||
const modalDOMNormal = document.getElementsByClassName('ms-resizable-modal')[0]; | ||
expect(modalDOMNormal.querySelector('.user-group-info')).toExist(); // includes group info | ||
|
||
const cmpWithHide = ReactDOM.render(<UDModal hideGroupUserInfo options={{animation: false}} show displayAttributes={displayAttributes} user={testUser}/>, document.getElementById("container")); | ||
expect(cmpWithHide).toExist(); | ||
const modalDOM = document.getElementsByClassName('ms-resizable-modal')[0]; | ||
expect(modalDOM.querySelector('.user-group-info')).toNotExist(); // not include group info | ||
}); | ||
}); |