From f5cc1a17a7fd38ba00e4d0ef9bc4114d0b47e0c8 Mon Sep 17 00:00:00 2001 From: Priscilla de Roode Date: Wed, 5 Mar 2025 10:53:28 -0300 Subject: [PATCH] BA-2334: fix flaky test --- .../modules/comments/web/Comments/__tests__/Comments.cy.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/components/modules/comments/web/Comments/__tests__/Comments.cy.tsx b/packages/components/modules/comments/web/Comments/__tests__/Comments.cy.tsx index 7f510e93..c518efd5 100644 --- a/packages/components/modules/comments/web/Comments/__tests__/Comments.cy.tsx +++ b/packages/components/modules/comments/web/Comments/__tests__/Comments.cy.tsx @@ -215,14 +215,15 @@ describe('Comments', () => { cy.step('Scroll to the bottom and see the next 5 comments') cy.findByText('Fourth comment').should('exist').scrollIntoView() + cy.findByText('Fifth comment').should('exist').scrollIntoView() cy.findByLabelText('loading more comments') .should('exist') - .scrollIntoView() .then(() => { resolveMostRecentOperation({ data: commentsNextPageMockData }) }) - cy.findByText('Fifth comment').should('exist') + + cy.findByLabelText('loading more comments').should('not.exist') cy.findByText('Sixth comment').should('exist').scrollIntoView() cy.findByText('Seventh comment').should('exist') cy.findByText('Eighth comment').should('exist').scrollIntoView() @@ -231,7 +232,6 @@ describe('Comments', () => { cy.step('Scroll to the bottom should not trigger another fetch') cy.findByText('Tenth comment').scrollIntoView() - cy.findByLabelText('loading more comments').should('not.exist') }) it('should be able to render all comment`s replies', () => {