Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(AffectedClustersTable): Reset filters button update #186

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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