Skip to content
Snippets Groups Projects
Unverified Commit 5c667f56 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Unskip repro for #18021 and consolidate `recently-viewed` spec (#23615)

* Unskip repro for #18021

* Simplify "recently viewed" test by visiting the table directly

* Do not hard code IDs

* Merge repro for #18021 with the related spec
parent bc522f40
No related branches found
No related tags found
No related merge requests found
......@@ -2,18 +2,21 @@ import {
restore,
visitQuestion,
visitDashboard,
openPeopleTable,
describeEE,
} from "__support__/e2e/helpers";
describe(`search > recently viewed`, () => {
import { SAMPLE_DB_ID } from "__support__/e2e/cypress_data";
import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
const { PEOPLE_ID } = SAMPLE_DATABASE;
describe("search > recently viewed", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
cy.intercept("POST", "/api/dataset").as("dataset");
cy.visit("/browse/1-sample-database");
// "People" table
cy.findByTextEnsureVisible("People").click();
cy.wait("@dataset");
openPeopleTable();
cy.findByTextEnsureVisible("Address");
// "Orders" question
......@@ -40,7 +43,12 @@ describe(`search > recently viewed`, () => {
"/dashboard/1-orders-in-a-dashboard",
);
assertRecentlyViewedItem(1, "Orders", "Question", "/question/1-orders");
assertRecentlyViewedItem(2, "People", "Table", "/question#?db=1&table=3");
assertRecentlyViewedItem(
2,
"People",
"Table",
`/question#?db=${SAMPLE_DB_ID}&table=${PEOPLE_ID}`,
);
});
it("allows to select an item from keyboard", () => {
......@@ -52,6 +60,35 @@ describe(`search > recently viewed`, () => {
});
});
describeEE("search > recently viewed > enterprise features", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
cy.request("POST", "/api/moderation-review", {
status: "verified",
moderated_item_id: 1,
moderated_item_type: "card",
});
visitQuestion(1);
cy.findByTestId("qb-header-left-side").find(".Icon-verified");
});
it("should show verified badge in the 'Recently viewed' list (metabase#18021)", () => {
cy.findByPlaceholderText("Search…").click();
cy.findByText("Recently viewed")
.parent()
.within(() => {
cy.findByText("Orders")
.closest("a")
.find(".Icon-verified");
});
});
});
const assertRecentlyViewedItem = (index, title, type, link) => {
cy.findAllByTestId("recently-viewed-item")
.eq(index)
......
import { restore, isEE, visitQuestion } from "__support__/e2e/helpers";
describe.skip("issue 18021", () => {
beforeEach(() => {
// Run the test only for EE version
cy.onlyOn(isEE);
restore();
cy.signInAsAdmin();
cy.request("POST", "/api/moderation-review", {
status: "verified",
moderated_item_id: 1,
moderated_item_type: "card",
});
visitQuestion(1);
cy.findByTestId("saved-question-header-button").find(".Icon-verified");
});
it("should show verified badge in the 'Recently viewed' list (metabase#18021)", () => {
cy.findByPlaceholderText("Search…").click();
cy.findByText("Recently viewed")
.parent()
.within(() => {
cy.findByText("Orders")
.closest("a")
.find(".Icon-verified");
});
});
});
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