mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-09 03:10:48 +00:00
Merge pull request #8524 from overleaf/ae-detached-test
Attempt to fix flaky Cypress test GitOrigin-RevId: c49ec0b763e5dd3dde8c207021f1cb1a504f426c
This commit is contained in:
parent
7837af0afd
commit
34f15ba016
2 changed files with 3 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue