mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 12:24:25 +02:00
Merge pull request #8524 from overleaf/ae-detached-test
Attempt to fix flaky Cypress test GitOrigin-RevId: c49ec0b763e5dd3dde8c207021f1cb1a504f426c
This commit is contained in:
@@ -62,7 +62,7 @@ describe('<PdfPreviewDetachedRoot/>', function () {
|
||||
cy.findByRole('button', { name: 'Clear cached files' })
|
||||
.should('not.be.disabled')
|
||||
.click()
|
||||
.then(() => {
|
||||
.should(() => {
|
||||
expect(sysendTestHelper.getLastBroacastMessage()).to.deep.equal({
|
||||
role: 'detached',
|
||||
event: 'action-clearCache',
|
||||
|
||||
@@ -22,7 +22,7 @@ function getLastDetachCall(method) {
|
||||
}
|
||||
|
||||
function getLastBroacastMessage() {
|
||||
return getLastDetachCall('broadcast').args[1]
|
||||
return getLastDetachCall('broadcast')?.args[1]
|
||||
}
|
||||
|
||||
function getAllBroacastMessages() {
|
||||
@@ -32,7 +32,7 @@ function getAllBroacastMessages() {
|
||||
// this fakes receiving a message by calling the handler add to `on`. A bit
|
||||
// funky, but works for now
|
||||
function receiveMessage(message) {
|
||||
getLastDetachCall('on').args[1](message)
|
||||
getLastDetachCall('on')?.args[1](message)
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user