Merge pull request #24467 from overleaf/msm-fix-sp-e2e

[CE/SP] e2e fixes

GitOrigin-RevId: 32722dd7d7520e87cd8d8cf6dbdadec73b27caa6
This commit is contained in:
Miguel Serrano
2025-03-26 09:20:30 +01:00
committed by Copybot
parent 29238e54e3
commit 1ab8302254
3 changed files with 13 additions and 13 deletions

View File

@@ -149,10 +149,10 @@ describe('editor', () => {
openFile(fileName, 'static')
cy.log('reject changes')
cy.findByText('Review').click()
cy.contains('.toolbar-item', 'Review').click()
cy.get('.cm-content').should('not.contain.text', oldContent)
cy.findByText('Reject').click({ force: true })
cy.findByText('Review').click()
cy.findByText('Reject change').click({ force: true })
cy.contains('.toolbar-item', 'Review').click()
cy.log('recompile to force flush')
recompile()
@@ -205,10 +205,10 @@ describe('editor', () => {
openFile(fileName, 'static')
cy.log('reject changes')
cy.findByText('Review').click()
cy.contains('.toolbar-item', 'Review').click()
cy.get('.cm-content').should('not.contain.text', oldContent)
cy.findAllByText('Reject').first().click({ force: true })
cy.findByText('Review').click()
cy.findAllByText('Reject change').first().click({ force: true })
cy.contains('.toolbar-item', 'Review').click()
cy.log('recompile to force flush')
recompile()

View File

@@ -24,7 +24,7 @@ export function prepareWaitForNextCompileSlot() {
queueReset()
triggerCompile()
cy.log('Wait for compile to finish')
cy.findByText('Recompile')
cy.findByText('Recompile').should('be.visible')
})
}
function recompile() {

View File

@@ -212,11 +212,11 @@ export function createNewFile() {
export function toggleTrackChanges(state: boolean) {
cy.findByText('Review').click()
cy.get('.rp-tc-state-collapse').then(el => {
// TODO: simplify this in the frontend?
if (el.hasClass('rp-tc-state-collapse-on')) {
// make track-changes switches visible
cy.get('.rp-tc-state-collapse').click()
cy.get('.track-changes-menu-button').then(el => {
// when the menu is expanded renders the `expand_more` icon,
// and the `chevron_right` icon when it's collapsed
if (!el.text().includes('expand_more')) {
el.click()
}
})
@@ -241,5 +241,5 @@ export function toggleTrackChanges(state: boolean) {
cy.wait(alias)
})
})
cy.findByText('Review').click()
cy.contains('.toolbar-item', 'Review').click()
}