mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 05:11:34 +02:00
18 lines
478 B
TypeScript
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')
|
|
)
|
|
}
|