Skip to content

Commit

Permalink
fix: Assert post message to wait for save to happen
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Apr 19, 2024
1 parent 33e6712 commit 69bae14
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cypress/e2e/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down

0 comments on commit 69bae14

Please sign in to comment.