-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropdown param search fix #5304
Changes from 1 commit
c0ddc22
eb38c98
80abf84
3e6a7cf
94127eb
2745c1a
36a8f85
20c6fe9
d9c373e
d823d45
cd43059
25eda02
325dfa0
92aa5db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
function openAndSearchAntdDropdown(paramOption) { | ||
// assures filters are working | ||
cy.getByTestId("ParameterValueInput").type(paramOption); | ||
|
||
// only the filtered option should be on the DOM | ||
cy.get(".ant-select-item-option").each($option => { | ||
expect($option).to.contain(paramOption); | ||
}); | ||
|
||
cy.getByTestId("ParameterValueInput") | ||
.find("input") | ||
.clear(); | ||
} | ||
describe("Parameter", () => { | ||
const expectDirtyStateChange = edit => { | ||
cy.getByTestId("ParameterName-test-parameter") | ||
|
@@ -91,7 +104,7 @@ describe("Parameter", () => { | |
}); | ||
}); | ||
|
||
describe.only("Dropdown Parameter", () => { | ||
describe("Dropdown Parameter", () => { | ||
beforeEach(() => { | ||
const queryData = { | ||
name: "Dropdown Parameter", | ||
|
@@ -120,15 +133,6 @@ describe("Parameter", () => { | |
cy.getByTestId("TableVisualization").should("contain", "value2"); | ||
}); | ||
|
||
it("supports filters", () => { | ||
cy.getByTestId("ParameterValueInput").type("value1"); | ||
|
||
// only the filtered option should be on the DOM | ||
cy.get(".ant-select-item-option").each($option => { | ||
expect($option).to.contain("value1"); | ||
}); | ||
}); | ||
|
||
it("supports multi-selection", () => { | ||
cy.clickThrough(` | ||
ParameterSettings-test-parameter | ||
|
@@ -149,6 +153,8 @@ describe("Parameter", () => { | |
} | ||
}); | ||
|
||
openAndSearchAntdDropdown("value1"); // asserts option filter prop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to place it in the it("updates the results after selecting a value", () => {
/*cy.getByTestId("ParameterName-test-parameter")
.find(".ant-select")
.click();*/ // remove
openAndSearchAntdDropdown("ParameterName-test-parameter", "value2"); // asserts option filter prop
cy.contains(".ant-select-item-option", "value2").click();
cy.getByTestId("ParameterApplyButton").click();
// ensure that query is being executed
cy.getByTestId("QueryExecutionStatus").should("exist");
cy.getByTestId("TableVisualization").should("contain", "value2");
}); |
||
|
||
cy.getByTestId("QueryEditor").click(); // just to close the select menu | ||
|
||
cy.getByTestId("ParameterApplyButton").click(); | ||
|
@@ -247,6 +253,8 @@ describe("Parameter", () => { | |
cy.wrap($option).click(); | ||
}); | ||
|
||
openAndSearchAntdDropdown("value1"); // asserts option filter prop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I initially thought the Query Based Parameters already had a similar test for only 1 value selection 😅. But I guess we can just create a new one based on the Enum parameter "updates the results after selecting a value"? |
||
|
||
cy.getByTestId("QueryEditor").click(); // just to close the select menu | ||
|
||
cy.getByTestId("ParameterApplyButton").click(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily, your function doesn't enforce this 😝