Skip to content

Commit

Permalink
fix(AffectedClustersTable): rename reset filters button (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fewwy authored Mar 21, 2022
1 parent 8045caa commit c5111cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ const AffectedClustersTable = ({ query, rule, afterDisableFn }) => {
? undefined
: {
filters: chips,
deleteTitle: intl.formatMessage(messages.resetFilters),
onDelete: onChipDelete,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ describe('non-empty successful affected clusters table', () => {

it('no chips are displayed by default', () => {
cy.get(CHIP_GROUP).should('not.exist');
cy.get('button').contains('Clear filters').should('not.exist');
cy.get('button').contains('Reset filters').should('not.exist');
});

// outer loop required to clean up filter bar
Expand All @@ -345,7 +345,7 @@ describe('non-empty successful affected clusters table', () => {
.find(CHIP_GROUP)
.should('contain', 'Name')
.and('contain', el);
cy.get('button').contains('Clear filters').should('exist');
cy.get('button').contains('Reset filters').should('exist');
// check matched clusters
cy.wrap(filterData(el)).then((data) => {
if (data.length === 0) {
Expand All @@ -362,9 +362,9 @@ describe('non-empty successful affected clusters table', () => {
});
});

it('can clear filters', () => {
it('can Reset filters', () => {
cy.get(TABLE).find('#name-filter').type('custom');
cy.get(TOOLBAR).find('button').contains('Clear filters').click();
cy.get(TOOLBAR).find('button').contains('Reset filters').click();
cy.get(TOOLBAR).find(CHIP_GROUP).should('not.exist');
checkRowCounts(Math.min(DEFAULT_ROW_COUNT, filterData().length));
});
Expand Down

0 comments on commit c5111cc

Please sign in to comment.