Skip to content
Snippets Groups Projects
Unverified Commit b5c995a0 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Load metadata for a new model/question (#29278)

parent 6154130e
No related branches found
No related tags found
No related merge requests found
import {
filter,
filterField,
filterFieldPopover,
modal,
popover,
restore,
} from "e2e/support/helpers";
describe("issue 28971", () => {
beforeEach(() => {
restore();
cy.signInAsNormalUser();
cy.intercept("POST", "/api/card").as("createCard");
cy.intercept("POST", "/api/dataset").as("dataset");
});
it("should be able to filter a newly created model (metabase#28971)", () => {
cy.visit("/");
cy.findByText("New").click();
popover().within(() => cy.findByText("Model").click());
cy.findByText("Use the notebook editor").click();
popover().within(() => cy.findByText("Sample Database").click());
popover().within(() => cy.findByText("Orders").click());
cy.button("Save").click();
modal().within(() => cy.button("Save").click());
cy.wait("@createCard");
filter();
filterField("Quantity", { operator: "equal to" });
filterFieldPopover("Quantity").within(() => cy.findByText("20").click());
cy.button("Apply Filters").click();
cy.wait("@dataset");
cy.findByText("Quantity is equal to 20").should("exist");
cy.findByText("Showing 4 rows").should("exist");
});
});
......@@ -213,6 +213,9 @@ export const apiCreateQuestion = question => {
const card = createdQuestion.lockDisplay().card();
dispatch.action(API_CREATE_QUESTION, card);
const metadataOptions = { reload: createdQuestion.isDataset() };
await dispatch(loadMetadataForCard(card, metadataOptions));
};
};
......
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