Skip to content
Snippets Groups Projects
Unverified Commit 8cb8d640 authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

Combine search e2e specs (#43718)

parent df62bb0c
No related branches found
No related tags found
No related merge requests found
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import { restore } from "e2e/support/helpers";
const { REVIEWS_ID } = SAMPLE_DATABASE;
describe.skip("issue 16785", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
cy.request("PUT", "/api/table", {
ids: [REVIEWS_ID],
visibility_type: "hidden",
});
});
it("should not display hidden tables (metabase#16785)", () => {
cy.visit("/");
cy.findByPlaceholderText("Search…").type("Reviews");
cy.findByTestId("search-results-list").within(() => {
cy.findByText("Reviews").should("not.exist");
});
});
});
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import {
isScrollableHorizontally,
restore,
visitFullAppEmbeddingUrl,
} from "e2e/support/helpers";
const { PEOPLE_ID } = SAMPLE_DATABASE;
const LONG_STRING = "01234567890ABCDEFGHIJKLMNOPQRSTUVXYZ0123456789";
describe("issue 28788", () => {
beforeEach(() => {
restore();
cy.signInAsNormalUser();
cy.intercept("GET", "/api/search*").as("search");
});
it("search results container should not be scrollable horizontally (metabase#28788)", () => {
const questionDetails = {
name: `28788-${LONG_STRING}`,
type: "model",
description: LONG_STRING,
query: {
"source-table": PEOPLE_ID,
},
};
cy.createCollection({
name: `Collection-${LONG_STRING}`,
}).then(({ body: collection }) => {
cy.createQuestion({
...questionDetails,
collection_id: collection.id,
});
});
visitFullAppEmbeddingUrl({ url: "/", qs: { top_nav: true, search: true } });
cy.findByPlaceholderText("Search…").type(questionDetails.name);
cy.wait("@search");
cy.icon("hourglass").should("not.exist");
cy.findByTestId("search-bar-results-container").then($container => {
expect(isScrollableHorizontally($container[0])).to.be.false;
});
});
});
......@@ -10,9 +10,10 @@ import {
main,
restore,
visitFullAppEmbeddingUrl,
isScrollableHorizontally,
} from "e2e/support/helpers";
const { ORDERS_ID } = SAMPLE_DATABASE;
const { ORDERS_ID, PEOPLE_ID, REVIEWS_ID } = SAMPLE_DATABASE;
const visitEmbeddingWithSearch = (url = "/") => {
visitFullAppEmbeddingUrl({
......@@ -254,3 +255,62 @@ describe("scenarios > search", () => {
});
});
});
describe.skip("issue 16785", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
cy.request("PUT", "/api/table", {
ids: [REVIEWS_ID],
visibility_type: "hidden",
});
});
it("should not display hidden tables (metabase#16785)", () => {
cy.visit("/");
cy.findByPlaceholderText("Search…").type("Reviews");
cy.findByTestId("search-results-list").within(() => {
cy.findByText("Reviews").should("not.exist");
});
});
});
describe("issue 28788", () => {
const LONG_STRING = "01234567890ABCDEFGHIJKLMNOPQRSTUVXYZ0123456789";
beforeEach(() => {
restore();
cy.signInAsNormalUser();
cy.intercept("GET", "/api/search*").as("search");
});
it("search results container should not be scrollable horizontally (metabase#28788)", () => {
const questionDetails = {
name: `28788-${LONG_STRING}`,
type: "model",
description: LONG_STRING,
query: {
"source-table": PEOPLE_ID,
},
};
cy.createCollection({
name: `Collection-${LONG_STRING}`,
}).then(({ body: collection }) => {
cy.createQuestion({
...questionDetails,
collection_id: collection.id,
});
});
visitFullAppEmbeddingUrl({ url: "/", qs: { top_nav: true, search: true } });
cy.findByPlaceholderText("Search…").type(questionDetails.name);
cy.wait("@search");
cy.icon("hourglass").should("not.exist");
cy.findByTestId("search-bar-results-container").then($container => {
expect(isScrollableHorizontally($container[0])).to.be.false;
});
});
});
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