73 lines
2.8 KiB
JavaScript
73 lines
2.8 KiB
JavaScript
// The Lucia project.
|
|
// Copyright 2026-2026 DSP, inc. All rights reserved.
|
|
// Authors:
|
|
// imacat.yang@dsp.im (imacat), 2026/03/05
|
|
|
|
import { loginWithFixtures } from "../support/intercept";
|
|
|
|
describe("Files to Discover Entry Flow", () => {
|
|
beforeEach(() => {
|
|
loginWithFixtures();
|
|
cy.visit("/files");
|
|
cy.wait("@getFiles");
|
|
});
|
|
|
|
describe("double-click table row to enter Discover", () => {
|
|
it("double-click log file navigates to Map page", () => {
|
|
// Target the Name column (has class .fileName) to avoid matching Dependency column
|
|
cy.contains("td.fileName", "sample-process.xes").parent("tr").dblclick();
|
|
cy.url().should("include", "/discover/log/1/map");
|
|
cy.wait("@getDiscover");
|
|
cy.get("#cy").should("exist");
|
|
});
|
|
|
|
it("double-click filter file navigates to Map page", () => {
|
|
cy.contains("td.fileName", "filtered-sample").parent("tr").dblclick();
|
|
cy.url().should("include", "/discover/filter/10/map");
|
|
cy.wait("@getFilterDiscover");
|
|
cy.get("#cy").should("exist");
|
|
});
|
|
});
|
|
|
|
describe("double-click grid card to enter Discover", () => {
|
|
beforeEach(() => {
|
|
// Switch to grid view
|
|
cy.get("svg").parent("li.cursor-pointer").last().click();
|
|
});
|
|
|
|
it("double-click log file grid card navigates to Map page", () => {
|
|
// Use last() to target the All Files grid section (not Recently Used)
|
|
cy.get('li[title="sample-process.xes"]').last().dblclick();
|
|
cy.url().should("include", "/discover/log/1/map");
|
|
cy.wait("@getDiscover");
|
|
cy.get("#cy").should("exist");
|
|
});
|
|
});
|
|
|
|
describe("DISCOVER tab filters files", () => {
|
|
it("clicking DISCOVER tab shows only Log, Filter, and Rule files", () => {
|
|
cy.get(".nav-item").contains("DISCOVER").click();
|
|
cy.contains("td.fileName", "sample-process.xes").should("exist");
|
|
cy.contains("td.fileName", "filtered-sample").should("exist");
|
|
cy.contains("td.fileName", "conformance-check-1").should("exist");
|
|
});
|
|
});
|
|
|
|
describe("Navbar state after entering Discover", () => {
|
|
it("shows DISCOVER heading and tabs after entering from Files", () => {
|
|
cy.contains("td.fileName", "sample-process.xes").parent("tr").dblclick();
|
|
cy.url().should("include", "/discover/");
|
|
cy.get("#nav_bar").contains("DISCOVER").should("be.visible");
|
|
cy.get(".nav-item").contains("MAP").should("exist");
|
|
cy.get(".nav-item").contains("CONFORMANCE").should("exist");
|
|
cy.get(".nav-item").contains("PERFORMANCE").should("exist");
|
|
});
|
|
|
|
it("shows back arrow pointing to /files", () => {
|
|
cy.contains("td.fileName", "sample-process.xes").parent("tr").dblclick();
|
|
cy.url().should("include", "/discover/");
|
|
cy.get("#backPage").should("have.attr", "href", "/files");
|
|
});
|
|
});
|
|
});
|