Skip to content
Snippets Groups Projects
Unverified Commit 7cb02ab6 authored by Mahatthana (Kelvin) Nomsawadi's avatar Mahatthana (Kelvin) Nomsawadi Committed by GitHub
Browse files

Add a reproduction for dashboard sticky filter incorrectly positioned when...

Add a reproduction for dashboard sticky filter incorrectly positioned when moving between dashboards (#29497)

* Add a repro for #26230

* Move the prep phase to the `beforeEach`

* Use `visitDashboard` helper

* Wait for the second dashboard to load

* You don't have to use `within` here

* Add a comment

* Add main repro assertion

* Greatly simplify creation of the markdown card

* Update the test title

---------

Co-authored-by: default avatarNemanja <31325167+nemanjaglumac@users.noreply.github.com>
parent 7d4f727d
No related branches found
No related tags found
No related merge requests found
import { restore, visitDashboard } from "e2e/support/helpers";
describe("issue 26230", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
prepareAndVisitDashboards();
});
it("should not preserve the sticky filter behavior when navigating to the second dashboard (metabase#26230)", () => {
cy.findByRole("main").scrollTo("bottom"); // This line is essential for the reproduction!
cy.button("Toggle sidebar").click();
cy.findByRole("main")
.findByDisplayValue("dashboard with a tall card 2")
.should("not.be.visible");
cy.findByTestId("dashboard-parameters-widget-container").should(
"have.css",
"position",
"fixed",
);
cy.intercept("GET", "/api/dashboard/*").as("loadDashboard");
cy.findByRole("listitem", { name: "dashboard with a tall card" }).click();
cy.wait("@loadDashboard");
cy.findByTestId("dashboard-parameters-widget-container").should(
"not.have.css",
"position",
"fixed",
);
});
});
function prepareAndVisitDashboards() {
cy.createDashboard({
name: "dashboard with a tall card",
parameters: [
{
id: "12345678",
name: "Text",
slug: "text",
type: "string/=",
sectionId: "string",
},
],
}).then(({ body: { id } }) => {
createTextDashcard(id);
bookmarkDashboard(id);
});
cy.createDashboard({
name: "dashboard with a tall card 2",
parameters: [
{
id: "87654321",
name: "Text",
slug: "text",
type: "string/=",
sectionId: "string",
},
],
}).then(({ body: { id } }) => {
createTextDashcard(id);
bookmarkDashboard(id);
visitDashboard(id);
});
}
function bookmarkDashboard(dashboardId) {
cy.request("POST", `/api/bookmark/dashboard/${dashboardId}`);
}
function createTextDashcard(id) {
cy.request("POST", `/api/dashboard/${id}/cards`, {
cardId: null,
col: 0,
row: 0,
size_x: 4,
size_y: 20,
visualization_settings: {
virtual_card: {
name: null,
display: "text",
visualization_settings: {},
dataset_query: {},
archived: false,
},
text: "I am a tall card",
},
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment