Fleet UI: Reroute homepage (#1640)

* Reroute homepage
* Update e2e tests brittle URLs
This commit is contained in:
RachelElysia 2021-08-13 10:41:53 -04:00 committed by GitHub
parent 4858f3ace0
commit dc77974ef6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 21 additions and 18 deletions

View file

@ -0,0 +1 @@
* Homepage is now routed to /home instead of hosts/manage

View file

@ -19,7 +19,7 @@ describe("Hosts page", () => {
},
},
() => {
cy.visit("/");
cy.visit("/hosts/manage");
cy.contains("button", /add new host/i).click();
@ -40,7 +40,7 @@ describe("Hosts page", () => {
// testing, but may vary by environment).
cy.waitUntil(
() => {
cy.visit("/");
cy.visit("/hosts/manage");
return Cypress.$('button[title="Online"]').length > 0;
},
{ timeout: 30000, interval: 1000 }

View file

@ -15,8 +15,8 @@ describe("Sessions", () => {
cy.get("button").click();
// Verify dashboard
cy.url().should("include", "/hosts/manage");
cy.contains("All Hosts");
cy.url().should("include", "/home");
cy.contains("Hosts");
// Log out
cy.findByAltText(/user avatar/i).click();

View file

@ -17,8 +17,8 @@ describe("SSO Sessions", () => {
cy.contains("button", "Login").click();
// Verify dashboard
cy.url().should("include", "/hosts/manage");
cy.contains("All Hosts");
cy.url().should("include", "/home");
cy.contains("Hosts");
// Log out
cy.findByAltText(/user avatar/i).click();

View file

@ -14,7 +14,7 @@ describe("Basic tier - Admin user", () => {
it("Can perform the appropriate basic-tier admin actions", () => {
cy.login("anna@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure the hosts page is loaded
cy.contains("All hosts");

View file

@ -14,7 +14,7 @@ describe("Basic tier - Maintainer user", () => {
it("Can perform the appropriate basic global maintainer actions", () => {
cy.login("mary@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure page is loaded
cy.contains("All hosts");

View file

@ -14,7 +14,7 @@ describe("Basic tier - Observer user", () => {
it("Can perform the appropriate basic global observer actions", () => {
cy.login("oliver@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure page is loaded
cy.contains("All hosts");
@ -67,6 +67,8 @@ describe("Basic tier - Observer user", () => {
cy.visit("/schedule/manage");
cy.findByText(/you do not have permissions/i).should("exist");
cy.visit("/hosts/manage");
cy.contains(".table-container .data-table__table th", "Team").should(
"be.visible"
);

View file

@ -13,7 +13,7 @@ describe("Basic tier - Team observer/maintainer user", () => {
it("Can perform the appropriate team observer actions", () => {
cy.login("marco@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure page is loaded
cy.contains("Hosts");
@ -107,7 +107,7 @@ describe("Basic tier - Team observer/maintainer user", () => {
it("Can perform the appropriate maintainer actions", () => {
cy.login("marco@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure page is loaded and appropriate nav links are displayed
cy.contains("Hosts");

View file

@ -14,7 +14,7 @@ describe("Core tier - Admin user", () => {
it("Can perform the appropriate core-tier admin actions", () => {
cy.login("anna@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure page is loaded
cy.contains("All hosts");

View file

@ -14,7 +14,7 @@ describe("Core tier - Maintainer user", () => {
it("Can perform the appropriate core global maintainer actions", () => {
cy.login("mary@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure page is loaded
cy.contains("All hosts");

View file

@ -14,7 +14,7 @@ describe("Core tier - Observer user", () => {
it("Can perform the appropriate core global observer actions", () => {
cy.login("oliver@organization.com", "user123#");
cy.visit("/");
cy.visit("/hosts/manage");
// Ensure page is loaded
cy.contains("All hosts");

View file

@ -21,7 +21,7 @@ export default (currentUser) => {
name: "Home",
iconName: "logo",
location: {
regex: new RegExp(`^${URL_PREFIX}/home/dashboard`),
regex: new RegExp(`^${URL_PREFIX}/home`),
pathname: PATHS.HOMEPAGE,
},
},

View file

@ -69,8 +69,8 @@ const routes = (
<Route path="email/change/:token" component={EmailTokenRedirect} />
<Route path="logout" component={LogoutPage} />
<Route component={CoreLayout}>
<IndexRedirect to={PATHS.MANAGE_HOSTS} />
<Route path="home/dashboard" component={Homepage} />
<IndexRedirect to={PATHS.HOMEPAGE} />
<Route path="home" component={Homepage} />
<Route path="settings" component={AuthenticatedAdminRoutes}>
<Route component={SettingsWrapper}>
<Route path="organization" component={AdminAppSettingsPage} />

View file

@ -23,7 +23,7 @@ export default {
FLEET_403: `${URL_PREFIX}/403`,
FLEET_500: `${URL_PREFIX}/500`,
LOGIN: `${URL_PREFIX}/login`,
HOMEPAGE: `${URL_PREFIX}/home/dashboard`,
HOMEPAGE: `${URL_PREFIX}/home`,
LOGOUT: `${URL_PREFIX}/logout`,
MANAGE_HOSTS: `${URL_PREFIX}/hosts/manage`,
HOST_DETAILS: (host: IHost): string => {