From 6d6c4f7722516948b002a99e812a1b7bb5ddceed Mon Sep 17 00:00:00 2001 From: Aleksandr Voznesenskii Date: Thu, 5 May 2022 11:22:47 +0200 Subject: [PATCH] Fixed a bug Rewrote the test --- src/Components/ClusterRules/ClusterRules.js | 1 + src/Components/ClusterRules/ClusterRules.spec.ct.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Components/ClusterRules/ClusterRules.js b/src/Components/ClusterRules/ClusterRules.js index 9222ade17..d5115421c 100644 --- a/src/Components/ClusterRules/ClusterRules.js +++ b/src/Components/ClusterRules/ClusterRules.js @@ -231,6 +231,7 @@ const ClusterRules = ({ cluster }) => { }; const onSort = (_e, index, direction) => { + setExpandFirst(false); setFirstRule(''); return updateFilters({ ...filters, diff --git a/src/Components/ClusterRules/ClusterRules.spec.ct.js b/src/Components/ClusterRules/ClusterRules.spec.ct.js index 65d81a00c..4ea89fb45 100644 --- a/src/Components/ClusterRules/ClusterRules.spec.ct.js +++ b/src/Components/ClusterRules/ClusterRules.spec.ct.js @@ -208,13 +208,13 @@ describe('cluster rules table', () => { }); it('expand one row then sort', () => { - cy.get(ROOT).find('#expandable-toggle0').click(); + cy.get(ROOT).find('#expandable-toggle2').click(); cy.get(ROOT) .find('th[data-label=Description]') .find('button') .click() .click(); - cy.get('table').find('tr').find('td[id="expanded-content11"]'); + cy.get(EXPANDABLES).should('have.length', 2); }); describe('sorting', () => {