Move Access to Policies under Identity (#2348)

Signed-off-by: Daniel Valdivia
This commit is contained in:
Daniel Valdivia
2022-09-29 20:55:21 -07:00
committed by GitHub
parent a3b88567cc
commit 55330960e9
4 changed files with 27 additions and 22 deletions

View File

@@ -128,11 +128,9 @@ export const IAM_PAGES = {
ACCOUNT: "/identity/account",
ACCOUNT_ADD: "/identity/account/new-account",
USER_SA_ACCOUNT_ADD: "/identity/users/new-user-sa/:userName",
/* Access */
POLICIES: "/access/policies",
POLICY_ADD: "/access/add-policy",
POLICIES_VIEW: "/access/policies/*",
POLICIES: "/identity/policies",
POLICY_ADD: "/identity/add-policy",
POLICIES_VIEW: "/identity/policies/*",
/* Monitoring */
TOOLS_LOGS: "/tools/logs",
TOOLS_AUDITLOGS: "/tools/audit-logs",

View File

@@ -107,15 +107,15 @@ export const validRoutes = (
icon: AccountsMenuIcon,
forceDisplay: true,
},
{
name: "Policies",
component: NavLink,
id: "policies",
to: IAM_PAGES.POLICIES,
icon: AccessMenuIcon,
},
],
},
{
name: "Access",
component: NavLink,
id: "access",
to: IAM_PAGES.POLICIES,
icon: AccessMenuIcon,
},
{
name: "Monitoring",

View File

@@ -18,7 +18,11 @@ import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import * as constants from "../utils/constants";
import { Selector } from "testcafe";
import { iamPoliciesElement } from "../utils/elements-menu";
import {
iamPoliciesElement,
identityElement,
usersElement,
} from "../utils/elements-menu";
const iamPolicyListItem = Selector(
".ReactVirtualized__Table__rowColumn"
@@ -37,7 +41,12 @@ fixture("For user with IAM Policies permissions")
test("IAM Policies sidebar item exists", async (t) => {
const iamPoliciesExist = iamPoliciesElement.exists;
await t.expect(iamPoliciesExist).ok();
await t
.expect(identityElement.exists)
.ok()
.click(identityElement)
.expect(iamPoliciesExist)
.ok();
});
test("Create Policy button exists", async (t) => {

View File

@@ -55,18 +55,16 @@ export const identityChildren = Selector("#identity-children");
export const usersElement = identityChildren
.find("a")
.withAttribute("href", "/identity/users");
.withAttribute("href", IAM_PAGES.USERS);
export const groupsElement = identityChildren
.find("a")
.withAttribute("href", "/identity/groups");
.withAttribute("href", IAM_PAGES.GROUPS);
export const serviceAcctsElement = identityChildren
.find("a")
.withAttribute("href", "/identity/account");
export const iamPoliciesElement = sidebarItem.withAttribute(
"href",
"/access/policies"
);
.withAttribute("href", IAM_PAGES.ACCOUNT);
export const iamPoliciesElement = identityChildren
.find("a")
.withAttribute("href", IAM_PAGES.POLICIES);
export const configurationsElement = Selector(".MuiPaper-root")
.find("ul")