overleaf/services/web/cypress/support/shared/commands/linked-file.ts
Mathias Jakobsen 988fc57574 Merge pull request #13077 from overleaf/mj-figure-modal-tests
[web] Add cypress tests for figure modal

GitOrigin-RevId: 4debae1c665a68fd7bfa9f0dcfc150bec38a7c64
2023-05-17 08:06:33 +00:00

12 lines
363 B
TypeScript

import { HttpRequestInterceptor } from 'cypress/types/net-stubbing'
export const interceptLinkedFile = () => {
cy.intercept(
{ method: 'POST', url: '/project/*/linked_file' },
cy
.spy((req: Parameters<HttpRequestInterceptor>[0]) => {
req.reply({ statusCode: 200, body: { success: true } })
})
.as('linked-file-request')
)
}