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

[SQL filters coverage] Add initial set of e2e tests around SQL field filter type of ID (#16926)


* Add test for SQL field filter of the type ID

* Fix spelling

Co-authored-by: default avatarGustavo Saiani <gustavo@poe.ma>
parent f6f4f0c7
No related merge requests found
import {
restore,
mockSessionProperty,
openNativeEditor,
} from "__support__/e2e/cypress";
import * as SQLFilter from "./helpers/e2e-sql-filter-helpers";
import * as FieldFilter from "./helpers/e2e-field-filter-helpers";
describe("scenarios > filters > sql filters > field filter > ID", () => {
beforeEach(() => {
restore();
cy.intercept("POST", "api/dataset").as("dataset");
cy.signInAsAdmin();
// Make sure feature flag is on regardless of the environment where this is running
mockSessionProperty("field-filter-operators-enabled?", true);
openNativeEditor();
SQLFilter.enterParameterizedQuery(
"SELECT * FROM products WHERE {{filter}}",
);
SQLFilter.openTypePickerFromDefaultFilterType();
SQLFilter.chooseType("Field Filter");
FieldFilter.mapTo({
table: "Products",
field: "ID",
});
FieldFilter.setWidgetType("ID");
});
it("should work when set initially as default value and then through the filter widget", () => {
SQLFilter.toggleRequired();
FieldFilter.openEntryForm({ isFilterRequired: true });
FieldFilter.addDefaultStringFilter("2");
SQLFilter.runQuery();
cy.get(".Visualization").within(() => {
cy.findByText("Small Marble Shoes");
});
FieldFilter.openEntryForm();
FieldFilter.addWidgetStringFilter("1");
SQLFilter.runQuery();
cy.get(".Visualization").within(() => {
cy.findByText("Rustic Paper Wallet");
});
});
});
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