Files
overleaf-cep/services/web/cypress/support/shared/commands/upload.ts
Alf Eaton ce4ca192ee Upgrade Storybook to v10 (#30442)
GitOrigin-RevId: 9f51624bc2b34b6746d1854969173b44c9c9cf9a
2026-04-22 08:06:26 +00:00

18 lines
478 B
TypeScript

export const interceptFileUpload = () => {
cy.intercept(
{ method: 'POST', url: /\/project\/.*\/upload/ },
cy
.spy(req => {
const folderMatch = req.url.match(
/project\/.*\/upload\?folder_id=[a-f0-9]{24}/
)
if (folderMatch) {
req.reply({ statusCode: 200, body: { success: true } })
} else {
req.reply({ statusCode: 500, body: { success: false } })
}
})
.as('uploadRequest')
)
}