Merge pull request #34189 from overleaf/mj-fix-flaky-review-panel-tests

[web] Fix flaky <ReviewPanel /> Cypress tests

GitOrigin-RevId: b34dc9a0ca53da5a282513e8fb92297e4b2f702a
This commit is contained in:
Mathias Jakobsen
2026-06-02 10:45:27 +01:00
committed by Copybot
parent 78bea8d574
commit 98bd09c31d
@@ -205,6 +205,9 @@ describe('<ReviewPanel />', function () {
</TestContainer>
)
// Wait for the editor to be ready before interacting with it
cy.get('.cm-content').should('have.css', 'opacity', '1')
// Open the review panel with keyboard shortcut
cy.findByText('contentLine 0').type('{command}j', { scrollBehavior: false })
cy.findByText('contentLine 1').type('{ctrl}j', { scrollBehavior: false })
@@ -726,7 +729,7 @@ describe('<ReviewPanel /> in mini mode', function () {
},
])
cy.intercept('GET', '/project/*/threads', threads)
cy.intercept('GET', '/project/*/threads', threads).as('loadThreads')
cy.intercept('POST', `/project/*/doc/${docId}/metadata`, {})
@@ -745,6 +748,10 @@ describe('<ReviewPanel /> in mini mode', function () {
// Wait for editor
cy.get('.cm-content').should('have.css', 'opacity', '1')
// Wait for the threads to load, since mini mode renders conditionally on
// the threads/ranges data being present
cy.wait('@loadThreads')
// Toggle the review panel twice to ensure data is loaded
cy.findByText('contentLine 0').type('{command}jj', {
scrollBehavior: false,
@@ -882,6 +889,9 @@ describe('<ReviewPanel /> for free users', function () {
</TestContainer>
)
// Wait for the editor to be ready before interacting with it
cy.get('.cm-content').should('have.css', 'opacity', '1')
cy.findByLabelText('Editing').click()
cy.findByRole('menu').within(() => {
cy.findByText(/Reviewing/).click()