63 lines
1.9 KiB
JavaScript
63 lines
1.9 KiB
JavaScript
// The Lucia project.
|
|
// Copyright 2026-2026 DSP, inc. All rights reserved.
|
|
// Authors:
|
|
// imacat.yang@dsp.im (imacat), 2026/03/05
|
|
|
|
import { loginWithFixtures, setupApiIntercepts } from "../support/intercept";
|
|
|
|
describe("Navigation and Routing", () => {
|
|
it("redirects / to /files when logged in", () => {
|
|
loginWithFixtures();
|
|
cy.visit("/");
|
|
cy.url().should("include", "/files");
|
|
});
|
|
|
|
it("shows 404 page for unknown routes", () => {
|
|
loginWithFixtures();
|
|
cy.visit("/nonexistent-page");
|
|
cy.contains("404").should("exist");
|
|
});
|
|
|
|
it("navbar shows correct view name", () => {
|
|
loginWithFixtures();
|
|
cy.visit("/files");
|
|
cy.contains("sample-process.xes").should("exist");
|
|
cy.get("#nav_bar").should("exist");
|
|
cy.get("#nav_bar h2").should("contain", "FILES");
|
|
});
|
|
|
|
it("navbar shows back arrow on non-files pages", () => {
|
|
loginWithFixtures();
|
|
cy.visit("/discover/log/1/map");
|
|
// Back arrow should be visible on discover pages
|
|
cy.get("#backPage").should("exist");
|
|
});
|
|
|
|
it("navbar tabs are clickable on discover page", () => {
|
|
loginWithFixtures();
|
|
cy.visit("/discover/log/1/map");
|
|
// Discover navbar should show MAP, CONFORMANCE, PERFORMANCE tabs
|
|
cy.contains(".nav-item", "MAP").should("exist");
|
|
cy.contains(".nav-item", "CONFORMANCE").should("exist");
|
|
cy.contains(".nav-item", "PERFORMANCE").should("exist");
|
|
|
|
// Click CONFORMANCE tab
|
|
cy.contains(".nav-item", "CONFORMANCE").click();
|
|
cy.url().should("include", "/conformance");
|
|
|
|
// Click PERFORMANCE tab
|
|
cy.contains(".nav-item", "PERFORMANCE").click();
|
|
cy.url().should("include", "/performance");
|
|
|
|
// Click MAP tab to go back
|
|
cy.contains(".nav-item", "MAP").click();
|
|
cy.url().should("include", "/map");
|
|
});
|
|
|
|
it("login page is accessible at /login", () => {
|
|
setupApiIntercepts();
|
|
cy.visit("/login");
|
|
cy.get("h2").should("contain", "LOGIN");
|
|
});
|
|
});
|