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

[E2E] Remove `admin_setup` spec from smoke tests (#23458)

* Remove redundant check

* Delete data model tests from the admin setup spec

* Refactor hide tables spec

* Remove admin_setup spec

* Add a dummy test so that CircleCI job doesn't fail
parent 1fd13370
No related branches found
No related tags found
No related merge requests found
import { restore, startNewQuestion } from "__support__/e2e/cypress";
const ORDERS_URL = "/admin/datamodel/database/1/table/2";
import { SAMPLE_DB_ID } from "__support__/e2e/cypress_data";
import { SAMPLE_DATABASE } from "__support__/e2e/cypress_sample_database";
describe("scenarios > admin > datamodel > hidden tables (metabase#9759)", () => {
beforeEach(restore);
const { ORDERS_ID } = SAMPLE_DATABASE;
it("can hide a table and not show up in 'Our Data'", () => {
cy.server();
cy.route("PUT", "/api/table/*").as("tableUpdate");
describe("scenarios > admin > datamodel > hidden tables (metabase#9759)", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
// Toggle the table to be hidden as admin user
cy.signInAsAdmin();
cy.visit(ORDERS_URL);
cy.contains(/^Hidden$/).click();
cy.wait("@tableUpdate");
hideTable(ORDERS_ID);
});
it("hidden table should not show up in various places in UI", () => {
// Visit the main page, we shouldn't be able to see the table
cy.visit("/browse/1");
cy.contains("Products");
cy.contains("Orders").should("not.exist");
// It shouldn't show up as a normal user either
// It shouldn't show up for a normal user either
cy.signInAsNormalUser();
cy.visit("/browse/1");
cy.contains("Products");
cy.contains("Orders").should("not.exist");
});
it("can hide a table and not show up in 'New Question' for a user", () => {
cy.server();
cy.route("PUT", "/api/table/*").as("tableUpdate");
// Toggle the table to be hidden as admin user
cy.signInAsAdmin();
cy.visit(ORDERS_URL);
cy.contains(/^Hidden$/).click();
cy.wait("@tableUpdate");
// It shouldn't show up as a normal user either
cy.signInAsNormalUser();
// It shouldn't show in a new question data picker
startNewQuestion();
cy.contains("Sample Database").click();
cy.contains("Products");
cy.contains("Orders").should("not.exist");
});
});
function hideTable(table) {
const TABLE_URL = `/admin/datamodel/database/${SAMPLE_DB_ID}/table/${table}`;
cy.intercept("PUT", `/api/table/${table}`).as("tableUpdate");
cy.visit(TABLE_URL);
cy.contains(/^Hidden$/).click();
cy.wait("@tableUpdate");
}
This diff is collapsed.
describe("hello", () => {
it("says hi", () => {
cy.log("hi");
});
});
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