-
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.
#10414: Remove the list of associated groups of logged in user from t…
…he User Details modal window (#10415) * #10414: Remove the list of associated groups of logged in user from the User Details modal window Description: - handle hide group info in user details modal by adding a cfg in Login plugin 'hideGroupUserInfo' - add unit test * #10414: Remove the list of associated groups of logged in user from the User Details modal window Description: - add migration guide notes related to the PR changes - edit in unit tests * #10414: Remove the list of associated groups of logged in user from the User Details modal window Description: - resolve review comments related to edits in migration file
- Loading branch information
1 parent
3edf3e6
commit 032cad4
Showing
3 changed files
with
79 additions
and
9 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 | ||
}); | ||
}); |