Fix Add filter button doesnt close popup after openning (#111917)
Co-authored-by: Su Tran <sutranbmt@gmail.com>
This commit is contained in:
parent
3920918d3a
commit
84a3536fe4
|
@ -55,6 +55,8 @@ function FilterBarUI(props: Props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onAddFilterClick = () => setIsAddFilterPopoverOpen(!isAddFilterPopoverOpen);
|
||||||
|
|
||||||
function renderItems() {
|
function renderItems() {
|
||||||
return props.filters.map((filter, i) => (
|
return props.filters.map((filter, i) => (
|
||||||
<EuiFlexItem key={i} grow={false} className="globalFilterBar__flexItem">
|
<EuiFlexItem key={i} grow={false} className="globalFilterBar__flexItem">
|
||||||
|
@ -81,7 +83,7 @@ function FilterBarUI(props: Props) {
|
||||||
const button = (
|
const button = (
|
||||||
<EuiButtonEmpty
|
<EuiButtonEmpty
|
||||||
size="s"
|
size="s"
|
||||||
onClick={() => setIsAddFilterPopoverOpen(true)}
|
onClick={onAddFilterClick}
|
||||||
data-test-subj="addFilter"
|
data-test-subj="addFilter"
|
||||||
className="globalFilterBar__addButton"
|
className="globalFilterBar__addButton"
|
||||||
>
|
>
|
||||||
|
|
|
@ -24,6 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||||
it('a11y test on add filter panel', async () => {
|
it('a11y test on add filter panel', async () => {
|
||||||
await PageObjects.discover.openAddFilterPanel();
|
await PageObjects.discover.openAddFilterPanel();
|
||||||
await a11y.testAppSnapshot();
|
await a11y.testAppSnapshot();
|
||||||
|
await PageObjects.discover.closeAddFilterPanel();
|
||||||
await filterBar.addFilter('OriginCityName', 'is', 'Rome');
|
await filterBar.addFilter('OriginCityName', 'is', 'Rome');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,10 @@ export class DiscoverPageObject extends FtrService {
|
||||||
await this.testSubjects.click('addFilter');
|
await this.testSubjects.click('addFilter');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async closeAddFilterPanel() {
|
||||||
|
await this.testSubjects.click('addFilter');
|
||||||
|
}
|
||||||
|
|
||||||
public async waitUntilSearchingHasFinished() {
|
public async waitUntilSearchingHasFinished() {
|
||||||
await this.testSubjects.missingOrFail('loadingSpinner', {
|
await this.testSubjects.missingOrFail('loadingSpinner', {
|
||||||
timeout: this.defaultFindTimeout * 10,
|
timeout: this.defaultFindTimeout * 10,
|
||||||
|
|
|
@ -199,5 +199,6 @@ export class FilterBarService extends FtrService {
|
||||||
public async selectIndexPattern(indexPatternTitle: string): Promise<void> {
|
public async selectIndexPattern(indexPatternTitle: string): Promise<void> {
|
||||||
await this.testSubjects.click('addFilter');
|
await this.testSubjects.click('addFilter');
|
||||||
await this.comboBox.set('filterIndexPatternsSelect', indexPatternTitle);
|
await this.comboBox.set('filterIndexPatternsSelect', indexPatternTitle);
|
||||||
|
await this.testSubjects.click('addFilter');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue