From c5111ccd68e56b4f2297384f77e57e81af374772 Mon Sep 17 00:00:00 2001 From: Fewwy <62722417+Fewwy@users.noreply.github.com> Date: Mon, 21 Mar 2022 14:44:47 +0100 Subject: [PATCH] fix(AffectedClustersTable): rename reset filters button (#186) --- .../AffectedClustersTable/AffectedClustersTable.js | 1 + .../AffectedClustersTable.spec.ct.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Components/AffectedClustersTable/AffectedClustersTable.js b/src/Components/AffectedClustersTable/AffectedClustersTable.js index 02e6826c..d9123273 100644 --- a/src/Components/AffectedClustersTable/AffectedClustersTable.js +++ b/src/Components/AffectedClustersTable/AffectedClustersTable.js @@ -245,6 +245,7 @@ const AffectedClustersTable = ({ query, rule, afterDisableFn }) => { ? undefined : { filters: chips, + deleteTitle: intl.formatMessage(messages.resetFilters), onDelete: onChipDelete, } } diff --git a/src/Components/AffectedClustersTable/AffectedClustersTable.spec.ct.js b/src/Components/AffectedClustersTable/AffectedClustersTable.spec.ct.js index eb6eb528..22f7b6cf 100644 --- a/src/Components/AffectedClustersTable/AffectedClustersTable.spec.ct.js +++ b/src/Components/AffectedClustersTable/AffectedClustersTable.spec.ct.js @@ -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 @@ -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) { @@ -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)); });