diff --git a/cypress/e2e/integration.spec.js b/cypress/e2e/integration.spec.js index fd4067ffcb..c734c931ad 100644 --- a/cypress/e2e/integration.spec.js +++ b/cypress/e2e/integration.spec.js @@ -90,6 +90,19 @@ describe('Nextcloud integration', function() { cy.get('.oc-dialog button.primary').click() + cy.get('@postMessage') + .should((spy) => { + const calls = spy.getCalls() + const findMatchingCall = calls.find(call => call.args[0].indexOf('"MessageId":"Action_Save_Resp"') !== -1) + if (!findMatchingCall) { + return expect(findMatchingCall).to.not.be.undefined + } + const object = JSON.parse(findMatchingCall.args[0]) + expect(object.Values).to.have.property('success', true) + expect(object.Values).to.have.property('fileName', 'document.rtf') + return expect(findMatchingCall).to.not.be.undefined + }) + cy.get('@loleafletframe').within(() => { cy.get('#closebutton').click() })