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', () => { it('check Invert option and Reset Option', () => {
cy.loadAndVisitProject('food.small'); cy.loadAndVisitProject('food.small');
cy.columnActionClick('Shrt_Desc', ['Text filter']); cy.columnActionClick('Shrt_Desc', ['Text filter']);

View File

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