Move textSearchCounter to static variable (#4257)

* Move textSearchCounter to static variable

* Add test for checkbox bug

* Add test for checkbox bug
This commit is contained in:
nikhilp3 2021-11-24 06:44:53 -06:00 committed by GitHub
parent ddad7b503d
commit 77d958c9d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -57,6 +57,16 @@ describe('Checks Text-filter + Case Sensitive + Regex', () => {
);
});
it('check multiple regex option', () => {
cy.loadAndVisitProject('food.mini');
cy.columnActionClick('Shrt_Desc', ['Text filter']);
cy.columnActionClick('Shrt_Desc', ['Text filter']);
cy.get('#regexCheckbox0').should('be.visible');
cy.get('#regexCheckbox1').should('be.visible').click();
cy.get('#regexCheckbox0').should('not.be.checked');
cy.get('#regexCheckbox1').should('be.checked');
});
it('check Invert option and Reset Option', () => {
cy.loadAndVisitProject('food.small');
cy.columnActionClick('Shrt_Desc', ['Text filter']);

View File

@ -41,12 +41,12 @@ class TextSearchFacet extends Facet {
this._query = config.query || null;
this._timerID = null;
this.textSearchFacetCounterForLabels = 0;
this._initializeUI();
this._update();
};
static textSearchFacetCounterForLabels = 0;
reset() {
this._query = null;
this._div.find(".input-container input").each(function() { this.value = ""; });
@ -203,9 +203,9 @@ class TextSearchFacet extends Facet {
};
_uniqueIdForLabels() {
return this.textSearchFacetCounterForLabels++;
return TextSearchFacet.textSearchFacetCounterForLabels++;
};
};
}
TextSearchFacet.reconstruct = function(div, uiState) {