From 30e1af40c345c614ba824909826dd08d31987a1a Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Wed, 25 May 2022 08:59:41 +0100 Subject: [PATCH] Fix test (#8130) GitOrigin-RevId: abb8cd37298c4c0ded4040401889127c27625562 --- .../pdf-preview/pdf-synctex-controls.spec.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/web/test/frontend/components/pdf-preview/pdf-synctex-controls.spec.tsx b/services/web/test/frontend/components/pdf-preview/pdf-synctex-controls.spec.tsx index d0f4a95770..42c4676941 100644 --- a/services/web/test/frontend/components/pdf-preview/pdf-synctex-controls.spec.tsx +++ b/services/web/test/frontend/components/pdf-preview/pdf-synctex-controls.spec.tsx @@ -208,8 +208,17 @@ describe('', function () { }).should('be.disabled') cy.wait('@sync-code').should(() => { + const messages = sysendTestHelper + .getAllBroacastMessages() + .map(item => item.args[1]) + + const message = messages.find( + message => message.event === 'action-setHighlights' + ) + // synctex is called locally and the result are broadcast for the detached tab - expect(sysendTestHelper.getLastBroacastMessage()).to.deep.equal({ + // NOTE: can't use `.to.deep.include({…})` as it doesn't match the nested array + expect(message).to.deep.equal({ role: 'detacher', event: 'action-setHighlights', data: { args: [mockHighlights] },