Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[App Search] Role mappings migration part 2 (elastic#94461)
* Add engines mock and fix mock role mapping The original asRoleMapping was merely for a smoke test in the shared component. Refactored to work better in App Search component * Add RoleMappingsLogic * Fix test description Co-authored-by: Jason Stoltzfus <[email protected]> * Fix test description Co-authored-by: Jason Stoltzfus <[email protected]> * Add flash messages when creating, updating or deleting * Add path and resetState calls Refactoring the tests showed me that some parts of the state weren’t being reset. * Refactor handleAuthProviderChange logic I some how got the test coverage at 100% with my wrong way of doing tests before (scary). When I fixed it I noticed that noting I could do would trigger the fallback of just returning the `[ANY_AUTH_PROVIDER]` array. After talking with Constance, we could not come up with a way to trigger it either, given the conditions. She had suggested removing the first return statement but that caused an empty array being returned sometimes. Ultimately, I was able to get it working and covered with these changes. * Refactor tests per PR feedback The places where `role: 'superuser’` was deleted in the listeners was a side effect of using `setRoleMappingData` and not `mount` * Add back deleted assertion * Copy nit Co-authored-by: Constance <[email protected]> Co-authored-by: Jason Stoltzfus <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Constance <[email protected]>
- Loading branch information